Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unaccountable Fake-Error from Sql Server
Message
From
11/06/2004 07:45:35
Emanuele Bonin
EB Soluzioni Informatiche
Tezze S/B, Italy
 
 
To
11/06/2004 06:10:42
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00912576
Message ID:
00912623
Views:
16
The error is on VFP7 and VFP8 and VFP9 Beta ... but in vfp9 beta i receive an italian message:
"L'istruzione associata non è preparata." (sound like: the associated istruction isn't prepared)

that is not the translation of:
"Connectivity error: Unable to retrieve specific error information. Driver is probably out of resources"

Deeping on my inquiry i found that the real problem problem is "UseMemoSize".
If you try this piece of code you can see the problem!
****--------------
SQLSetProp(0, "Displogin", 1)
Private nHandle
nHandle = SQLStringConnect('Driver=Sql Server')
Visual FoxPro;WSID=WXP04;DATABASE=ADB_Demo;Trusted_Connection=Yes')
If nHandle <= 0
MessageBox('No Connection')
Return
EndIf

Local i
Local cStmt, cStmtValues

&& UserMemoSize Default is 255

&& Do Error
CURSORSETPROP("UseMemoSize", 254, 0)

&& Don't Error
** CURSORSETPROP("UseMemoSize", 255, 0)
cStmt = 'Create Table #Temp(memo varchar(254) Null)'
SQLExec(nHandle, cStmt)

SQLExec(nHandle, 'Select * From #Temp', 'Temp')
Append Blank
&& Do Error
Replace Memo With '' In Temp
cStmt = 'Insert Into #Temp(Memo) Values (?Temp.Memo)'

&& Don't Error For any UsermemoSize
&& Replace Memo With NULL In Temp
&& cStmt = 'Insert Into #Temp(Memo) Values (?Temp.Memo)'

If SQLExec(nHandle, cStmt) < 0
MessageBox(Message())
endif

USE In Temp
SQLExec(nHandle, 'Select Count(*) As Cnt From #Temp', 'Temp')

MessageBox('Records inserted : ' + Tran(Temp.Cnt))
USE In Temp

SQLDisconnect(nHandle)
bye, Emanuele!
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform