Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DSN
Message
From
27/10/1998 14:10:31
 
 
To
27/10/1998 14:05:29
Robert Byrd
National Association of Homebuilders
Washington, District of Columbia, United States
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Re: DSN
Miscellaneous
Thread ID:
00151142
Message ID:
00151174
Views:
19
Hi Bob ---

No problem :)

>
>CREATE DATA worktbls\dataconn
>CREATE CONNECTION ConVar CONNSTRING "DRIVE={SQL Server}SERVER=LISTMAKER_II;UID=sa;PWD=;DATABASE=listmaker"
>
>=sqlprepare(ConVar,"Select * from list","list")
>=sqlexec(ConVar)
>
>When the SQLPREPARE executes I get the following error: "Variable ConVar is not found."
>

The problem is that you are not establishing a connection before doing the SQLPREPARE. If your connection name is ConVar you need a line like:

nConHandle=SQLCONNECT("ConVar")

After you've created the connection but before any other SQL statements. Then, you have to use nConHandle instead of ConVar for SQLPREPARE and SQLEXEC....just remember to use SQLDISCONNECT when done.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform