Source language: Translate to:

Error With DBPro

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Error With DBPro

Postby Pat Baner » Sun May 15, 2011 8:35 pm

I am using the following code to update my database/table/fields for multiple records:

SetVar "[DisputeGroup]" "1"
SetVar "[DisputeLetter]" "1"

dbpQuery "CRDB" "ClientAccounts" "DisputeNumber = 7"
dbpFirst "CRDB" "ClientAccounts"

If "[CRDB.ClientAccounts.$RecCount]" "=" "0"
GotoLine "3For2"
EndIf

Loop "1" "[CRDB.ClientAccounts.$RecCount]" "[Counter]"
SetVar "[CRDB.ClientAccounts.EQDisputeGroup]" "[DisputeGroup]"
SetVar "[CRDB.ClientAccounts.EQDisputeLetter]" "[DisputeLetter]"
SetVar "[CRDB.ClientAccounts.EXDisputeGroup]" "[DisputeGroup]"
SetVar "[CRDB.ClientAccounts.EXDisputeLetter]" "[DisputeLetter]"
SetVar "[CRDB.ClientAccounts.TUDisputeGroup]" "[DisputeGroup]"
SetVar "[CRDB.ClientAccounts.TUDisputeLetter]" "[DisputeLetter]"
Math "[DisputeLetter] + 1" "" "[DisputeLetter]"
If "[DisputeLetter]" "=" "23"
Math "[DisputeGroup] + 1" "" "[DisputeGroup]"
SetVar "[DisputeLetter]" "1"
EndIF
dbpNext "CRDB" "ClientAccounts"
EndLoop
SetVar "[Counter]" "0"

dbpShowAll "CRDB" "ClientAccounts"
dbpFirst "CRDB" "ClientAccounts"

While the loop is running, I get the following message:

"Key column information is insufficient or incorrect. Too many rows were affected by update". I get this message when the loop hits the "dbpNext "CRDB" "ClientAccounts" portion of the code.

Any suggestions?
Pat Baner
 
Posts: 75
Joined: Tue Jan 04, 2011 9:21 am

Postby Pat Baner » Sun May 15, 2011 11:08 pm

I also get another error at the dbpNext command that says:

Key column information is insufficient or incorrect. Too many rows were affected by update.

I tried putting delays in the loop to slow down the processing but it doesn't seem to matter.
Pat Baner
 
Posts: 75
Joined: Tue Jan 04, 2011 9:21 am

Postby Wrangler » Mon May 16, 2011 7:32 am

Try adding a primary key to the table. Make it Autoinc.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1505
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby Pat Baner » Mon May 16, 2011 7:52 am

That fixed it. Thanks a million!

I assume this field is pretty important to do on all tables?
Pat Baner
 
Posts: 75
Joined: Tue Jan 04, 2011 9:21 am

Postby Wrangler » Mon May 16, 2011 7:56 am

Seems it only causes problems not having it when performing certain queries. It is also useful when defining relationships. So I just create one whether it needs it or not, rather than try and figure out when it needs one.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1505
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest

cron