Using the 1.0.0.3 version.
What would be the fastest error configuration?
SQLSetError ERROR_TOSCREEN || ERROR_NOERRORCHK,err,1024
SQLSetError ERROR_NOERROR || ERROR_NOERRORCHK,err,1024
SQLSetError ERROR_NOERROR,err,1024
SQLSetError ERROR_NOERRORCHK,err,1024
or something else?
Running the following test code shows that all 4 configurations are pretty much the same.
Rem *** Include File: E:\Users\Nicholas\Visual Studio Projects\sql\SQLConstants.dba ***
Rem Created: 29/12/2002 01:09:06
Rem Included in Project: I:\Program Files\Dark Basic Software\Dark Basic Professional\Projects\TestSQL.dbpro
REM For the status function
#constant STATUS_NOTKNOWN -1
#constant STATUS_ISOPEN 1
#constant STATUS_TRANSACT 2
#constant STATUS_UPDATE 3
#constant STATUS_APPEND 4
#constant STATUS_BOOKMARK 5
#constant STATUS_RESTART 6
#constant STATUS_SCROLL 7
#constant STATUS_TRANSACT2 8
#constant STATUS_UPDATE2 9
#constant STATUS_DIRTY 10
#constant STATUS_NULL 11
#constant STATUS_NULLABLE 12
Rem For error reporting
#constant ERROR_NOERROR 0
REM Put error text into memory
#constant ERROR_TOMEM 1<<0
REM Display errors to the screen
#constant ERROR_TOSCREEN 1<<1
REM Reduce the amount of error checking
#constant ERROR_NOERRORCHK 1<<2
Rem Open options
#constant OPEN_DEFAULT 0
#constant OPEN_OPENEXCLUSIVE 1<<0
#constant OPEN_READONLY 1<<1
#constant OPEN_CURSORLIB 1<<2
#constant OPEN_NODIALOG 1<<3
#constant OPEN_DIALOG 1<<4
#constant OPEN_DYNASET 1<<5
#constant OPEN_SNAPSHOT 1<<6
#constant OPEN_DYNAMIC 1<<7
#constant OPEN_FORWARDONLY 1<<8
Rem Open options 2
#constant OPEN2_APPENDONLY 1<<0
#constant OPEN2_READONLY 1<<1
#constant OPEN2_BULKADD 1<<2
#constant OPEN2_MULTROWFETCH 1<<3
#constant OPEN2_SKIPDEL 1<<4
#constant OPEN2_USEBOOKMARK 1<<5
#constant OPEN2_NODIRTY 1<<6
#constant OPEN2_EXECUTEDIR 1<<7
#constant OPEN2_EXTENDEDFETCH 1<<8
#constant OPEN2_ALLOCMULTI 1<<9
dim yytime(10)
originaltime = timer()
rem database init
err=make memory(1024)
rem SQLSetError ERROR_TOSCREEN || ERROR_NOERRORCHK,err,1024
rem SQLSetError ERROR_NOERROR || ERROR_NOERRORCHK,err,1024
rem SQLSetError ERROR_NOERROR,err,1024
SQLSetError ERROR_NOERRORCHK,err,1024
ptr=make memory (1024)
x=SQLConnect("DRIVER={MySQL};SERVER=localhost;DATABASE=rpg;UID=farwalk;pwd=startrek;DNS=test",0)
rem x=SQLConnect("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=test.mdb;SERVER=localhost;DATABASE=test.mdb;UID=Nicholas Kingsley;DNS=rightcomputer",0)
print SQLGetConnect()
print SQLGetDatabaseName()
print "Table Name:";SQLGetTableName()
print
print "Error:";peekString$(err,4,0,0)
print "Connect:";
print x
rem end database init
for yy = 1 to 5
originaltime = timer()
for zz = 1 to 10
cls
rem save to database
for x = 2 to 5
rem zdata$ = "UPDATE playerdata SET px="+str$(px#(x))+",py="+str$(py#(x))+",pz="+str$(pz#(x))+" WHERE pid="+str$(pid(x))
zdata$ = "UPDATE playerdata SET px=99 WHERE pid=2"
xx = SQLExecute(zdata$)
next x
print "zz: ";str$(zz)
sync
next zz
yytime(yy) = timer()-originaltime
next yy
for yy = 1 to 5
print "Loop#"+str$(yy) + ": " + str$(yytime(yy))
sync
ltotal = ltotal + yytime(yy)
next yy
avg = ltotal/5
print "Average: " + str$(avg)
wait key
delete memory (err)
delete memory (ptr)
x=SQLDisconnect()
exit
Speed issues may be in computer/mySQL configuration though. My work computer deals with mySQL commands in DBPro slower than my home computer even though my work computer is a more powerfull computer.
-Farwalk