Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all 13329 articles
Browse latest View live

Position cursor in unbound textbox in Header

$
0
0
Hi to you all

I have a continuious form for inputing Athletics results, when I open the form I want the cursor to be positioned in an unbound textbox called "event" which is in the header of the form. This is so I can enter the event code and use DLookup to get AgeGroup, M/F and Event.
When I open the form it goes streight to entering the records. The table is always empty when I open the form as I am using it to sort records into the correct order and joining to another table for points awarded. I am using Access 2010.



Jim.

Access 07 VBA GrpFtrLoc problem

$
0
0
Hi - need some assistance adapting code for setting the report footer at the same place on page 1 of report........

These are invoices - each report is exactly the same number of controls, hdr, ftr, groups, expressions, etc.
Similar qry record sources.

The reports have a count of records in the report footer

I pulled this out of MSDN:
It says to use it for either Page Footer or Report Footer

1st step - the Module
MODULE: REPORTFOOTER
Sub SetGrpFtrLoc(Rpt As Report, GrpFtrLoc As Double)
GrpFtrLoc = GrpFtrLoc * 1440 'Convert from inches to twips.
If Rpt.Top < GrpFtrLoc Then 'Not at location yet, so
Rpt.MoveLayout = True 'move to next print location.
Rpt.NextRecord = False 'Do not go to next record.
Rpt.PrintSection = False 'Do not print the section.
End If 'Until the required offset is reached

End Sub

2nd step - the report
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
Call SetGrpFtrLoc(Me.Report, 6) 'Display report footer at least
'6 inches from the top of the page

End Sub


I'm getting unexpected results........I have this code in 2 different reports right now.
One report returns correctly if there are multiple records, if there is a single record the report footer is no where to be found. It is so many pages in print preview the report never stops formatting

The other report is exact opposite - correct on single record, multiple records generate uncountable number of pages where the report footer is

Do I need something to tell VBA it is only 1 page?
Any ideas?

Column Concatenation

$
0
0
I have 2 tables (forgive my syntax)

BID
=======
BIDID INT,
NAME NVARCHAR(10)
PK(BIDID)

BIDLINE
========
BIDLINEID INT(10)
BIDID INT (FK),
PK(BIDID, BIDLINEID)

So for each 'BID' Row there are many 'BIDLINE' Rows. What I am trying to do is: select all 'BID' Rows showing the concatenated 'BIDLINE.BIDLINEID' so.. the BIDLINEID's would be delimited list of all the bidlinesid's associated with this bidid

RESULTS:
==========================
BIDID | BIDLINEIDS

1 | 1,2,3,4,5
2 | 1,2,3
3 | 1,2,3,4,5,6,7

Help calculating bowling average for cricket

$
0
0
Hi all

Ive all but finished my cricket stats database but am stuck with the bowling part, when a bowler fails to complete an over it would look something like:

Overs bowled 12.3

This means they bowled 12 overs and 3 balls, when 6 balls have been bowled the over is completed but to calculate total overs bowled in a season i need to add all the overs and balls bowled together. The problem is scenario below

Match 1 - 12.4 overs
Match 2 - 9.5 overs

Total overs 21.9 overs ??????

Should be 22.3

This is not correct as there arent 9 balls in an over only 6, so when the balls equals 6 it adds another over on the over count and starts again at 0?

Can someone help? to those who have a knowledge of cricket this will make alot more sense.

PIVOT - Help

$
0
0
Hi there, I havent used the PIVOT function before.

I have the following table

id Row Dept
001 1 aaa
001 2 bbb
001 3 ccc
001 4 ddd
002 1 aaa
002 2 ccc

I would like it in the following format

id Dept1 Dept2 Dept3 Dept4
001 aaa bbb ccc ddd
002 aaa ccc

Is this possible?

Thanks in advance for any help

Need help with audit trail

$
0
0
I work on an OLTP database that has audit trail enable for most critical tables. Recently, all records from a table that was considered non-critical at implementation was deleted. How can I find out who did this and when it was done.

question on bufferpools

$
0
0
Hi,
I'm looking into a problem of a DB2 ESE 10.1 on Linux.
I'd like to know which size is the default bufferpool which I know was changed with the command
alter bufferpool ibmdefaultbp immediate size xxx automatic

How can I know which xxx this DB is using?

Thanks

NotInList error message

$
0
0
I am not very good with writing code so please be gentle with me. I have written NotInList code and it works in all but one of my databases. I am getting the following message "The text you entered isn't an item on the list - Select an item on the list or enter text that matches one of the listed items" when I look at the table the new entry is there - so why can't I select it?

Below is the code. Where am I going wrong?

Private Sub cmboAccount_number_NotInList(NewData As String, Response As Integer)
On Error GoTo cmboAccountNumber_NotInList_Err
Dim intAnswer As Integer
Dim strSql As String
intAnswer = MsgBox("The account number " & Chr(34) & NewData & Chr(34) & " is not currently listed." & vbCrLf & "Would you like to add it to the list now?", vbQuestion + vbYesNo, "tblAccountNumber")
If intAnswer = vbYes Then
strSql = "INSERT INTO tblAccountNumber([Account Number]) " & "VALUES ('" & NewData & "');"
DoCmd.SetWarnings False
DoCmd****nSQL strSql
DoCmd.SetWarnings True
MsgBox "The new account number has been added to the list.", vbInformation, "tblAccountNumber"
Response = acDataErrAdded
Else
MsgBox "Please choose an account number from the list.", vbInformation, "tblAccountNumber"
Response = acDataErrContinue
End If
cmboAccountNumber_NotInList_Exit:
Exit Sub
cmboAccountNumber_NotInList_Err:
MsgBox Err.Description, vbCritical, "Error"
Resume cmboAccountNumber_NotInList_Exit
End Sub

no value given for one or more parameters error

$
0
0
I have tried everything to solve this, and am lost at this point.
The error is: no value given for one or more parameters

The sql query is simple:

strsqlHor1 = "Select * from HorData where [User Number] = " & UNumber & _
" and [Location Number] = " & LNumber & " Order by Azimuth, Altitude"

It evaluates to
Select * from HorData where [User Number] = 1 and [Location Number] = 1 Order by Azimuth, Altitude

The HorData table has the two columns, spelled correctly. User and Location number 1 is there. So is Azimuth and Altitude and there are no null entries.

If I copy the sql from the vb6 program and run it in the database, it runs perfectly, no errors.

The database is passworded, and the connection string is:
PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\AHC\AHCData.mdb;Jet OLEDB:Database Password="nuIynhrV6HV8"

I am using VB6 and the ADOdc data control. Any help would be extremely appreciated as it has us at a halt at this point.

Bruce

lytec 2000 chiropractic

$
0
0
Greetings,

I'm in need of help with Lytec 2000 chiropractic stand alone. I did a fresh install of windows 7 32 bit on a machine because, it had several bad Trojans on it, and recommended to the customer to reinstall just to be sure. but before I did that I copied the lytec 2000 folder in two other places, as it appeared to hold the database. I installed windows 7, and then installed the lytec 2000 program, and copied back the lytec 2000 folder with all of the dat files in it. The first time it opened it came up with some errors with like the Table is full, so I turned off UAC and that took care of them issues, so I check on the data. This is where I need the help: Most of the data is there, but no data for this year 2013, and only half of 2012 is there. I have gone and opened up all of the copies, and they are they are same info. I even went into the windows.old folder which has everything saved, and the same thing. Missing data. Where did it go? is there other files somewhere else that hold that info. I went and compared files from all of the backups and they are the same size. I did the rebuild data, that did not fix anything. I have 3 copies of the same folders with the data but all have the same missing info. What am I missing? where else would some of the data be? if its not inside the lytec folder then where? I'm desperate for any info.

tcsh set environment variables in cron

$
0
0
Hi, I have a tcsh script that sets environment variables for another perl script to use. The script runs fine when I source the shell script of the extension .src and the perl script could read the environment variables as well. However, when I execute these two scripts in cron, the environment variable could not be found. Can I know what must I do to make cron sets the environment in tcsh? I've set the crontab shell to be on tcsh but it still fails to set the other environment variables.

db2diag error

$
0
0
hi every one

the following error is filling in db2 diag file.


2013-03-15-05.58.57.507997+330 I32285286A582 LEVEL: Error
PID : 30867584 TID : 6941 PROC : db2sysc 0
INSTANCE: db2qas NODE : 000 DB : QAS
APPHDL : 0-12 APPID: *LOCAL.DB2.130315002901
AUTHID : DB2PRD
EDUID : 6941 EDUNAME: db2evmli (DB6_EDLMON1) 0
FUNCTION: DB2 UDB, database monitor, sqmEvmonWriter::initTarget, probe:40
MESSAGE : ZRC=0x840D000C=-2079522804=SQLM_RC_EVIO2 "path not found"
DATA #1 : String, 11 bytes
DB6_EDLMON1
DATA #2 : String with size, 28 bytes
/db2/db2prd/db2event/edlmon1

2013-03-15-05.58.57.508156+330 I32285869A514 LEVEL: Error
PID : 30867584 TID : 6941 PROC : db2sysc 0
INSTANCE: db2qas NODE : 000 DB : QAS
APPHDL : 0-12 APPID: *LOCAL.DB2.130315002901
AUTHID : DB2PRD
EDUID : 6941 EDUNAME: db2evmli (DB6_EDLMON1) 0
FUNCTION: DB2 UDB, database monitor, sqmEvmonWriter::activate, probe:40
MESSAGE : ZRC=0x840D000C=-2079522804=SQLM_RC_EVIO2 "path not found"
DATA #1 : String, 11 bytes
DB6_EDLMON1


After i went trough error, i came to know that "/db2/db2prd/db2event/edlmon1" path doesnot exist on the system. i need to change the path to -"/db2/db2qas/db2event/edlmon1" how to cange the path ? please help me with this

Catch the shows online

Which data base is good for for storing 20gb a minute, 24x7..

$
0
0
Hi guys

Looking for your help in finding the right database for our application.

We have a real time calculation engine which generates 20 gb of data every minute, the application runs 24x7 and we need to keep last three days of data always.

Basically, the same set of calculation (1000 customers) happens every minute with little data change, hence we need to keep exiting calculations and new calculations as well. So, instead of over writing 20 gb of data every minute, we want to keep all calculations data.

I tried mongodb but the performance was very slow and finally thinking of storing in files in proto buf format and build a service to query the data. The query will be on customer id always.

Any guidance from you guys in solving this problem would of greate help.

Thanks
Mahendra

Earn up to Rs.25, 000/- PM through Fortune Infotech PJ020801035

$
0
0
Earn up to Rs. 25,000 per month Contact: 9924757838 Email: info.fortuneinfotech@ymail.com (PJ020801035) through simple online copy/paste work.100% Legitimate, Genuine & Scam Free Online Copy/Paste Jobs. Work at Home in your spare time. No work load, No Time Limit. Daily Basis Payment

How to avoid Deadlocks...

$
0
0
Hi,

I have two tables, table A and B.Table A is Master table and table B is child table.They are having foreign key between them.

There is Application X which updates/insertes in thse tables.
And there is Application Y which uses joins with table A, B and other tables and uses the data.

Now I am getting deadlocks and timeout in Application X and Y both.

How can I remove the deadlocks and timeout in the above case and both Application X and Y can use the tables effectively.

Start and End date of previous month

$
0
0
Hello

I have not used INformix for mnay many months and need to know how to calculate the start and end time of the previous month

Based on adm_date

Can anyone help me with this?

Kind Regards
Helen

Required to convert Oracle query to DB2 Query

$
0
0
Any champ of query conversion can test his knowledge :) Below is the oracle query.
Please see the attachment for desired result.

SELECT cols.owner schema,
cols.table_name,
cols.column_name tableField,
cols.data_type dataType,
CASE WHEN cols.data_type = 'NUMBER' THEN cols.data_precision
ELSE data_length
END maxLength,
CASE
WHEN cols.data_type = 'NUMBER' THEN ''''||((cols.data_precision - cols.data_scale)||'''' ||','|| ''''||cols.data_scale||'''')
ELSE TO_CHAR(data_length)
END dataSize,
cols.NULLABLE allowNull,
cons.constraint_type isPrimaryKey
FROM all_tab_columns cols
LEFT OUTER JOIN (SELECT cons.table_name,cons.owner,cons.column_name, MIN(cons.constraint_type) constraint_type
FROM (SELECT cons.table_name,cons.owner,cons.column_name, con.constraint_type
FROM all_cons_columns cons
INNER JOIN all_constraints con ON cons.table_name = con.table_name AND cons.owner = con.owner
AND cons.constraint_name = con.constraint_name AND con.constraint_type IN ('P','R','U')
AND cons.table_name = '(TableName)' AND cons.owner = '(SchemaName)'
UNION
SELECT idxcols.table_name,idxcols.table_owner,idxcols.col umn_name,'U' constraint_type
FROM all_ind_columns idxcols
WHERE EXISTS (SELECT 1
FROM all_indexes idx
WHERE idx.table_name = idxcols.table_name AND idx.table_owner = idxcols.table_owner
AND idx.index_name = idxcols.index_name AND idx.uniqueness = 'UNIQUE'
AND idx.table_name = '(TableName)' AND idx.table_owner = '(SchemaName)'
)) cons
GROUP BY cons.table_name,cons.owner,cons.column_name) cons
ON cols.table_name = cons.table_name AND cols.owner = cons.owner AND cols.column_name = cons.column_name
WHERE cols.table_name = '(TableName)'
AND cols.owner = '(SchemaName)'
ORDER BY cols.column_id

Attached Images
File Type: jpg Result_Image.jpg (128.8 KB)

need to speed up queries

$
0
0
Hi,
I'm using DB2 10.1 ESE on Linux.

My application runs 3 queries that are similar and all take long time to complete.


The queries structure is:

select t.col2, t.col3, t.col4 from MYSCHEMA.BIG_DATA_TABLE t , SESSION.ENABLED_SYSTEMS S where t.col1=s.col1 and t.col5=1

SESSION.ENABLED_SYSTEMS is a temporary table that is shared among all the 3 queries, it contains just an integer and has a size up to 300K rows.

MYSCHEMA.BIG_DATA_TABLE is a different table for the 3 queries, but in all the cases it contains a big number of rows (60 million the first, 30 million the second, 20 million the third).

In two cases all the involved columns are integer or smallint, just in the first case col3 is varchar(8000).

I tried a "index only access" approach and created an index for each of the 3 tables like:
create index MYSCHEMA.BIG_DATA_TABLE_IDX on MYSCHEMA.BIG_DATA_TABLE (col1,col5,col2,col3,col4)

(in order of decreasing cardinality for the predicate columns, couldn't use include clause because the index cannot be unique)

but the queries take too much time (from 2 to 4 minutes), I need to dramatically cut this time.

Could you please suggest how can achieve this?

Thank you!

Access 97 on Windows 8

$
0
0
the organization i work for has a lot of access 97 databases that I'm upgrading to vb and sql server, does anyone know if access 97 runs on windows 8? I'm trying to figure out how much time I have to upgrade certain databases. thanks, much appreciated

I did try searching on this but didn't come up with much.
Viewing all 13329 articles
Browse latest View live