Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trouble opening my SQL tables in my program
Message
From
29/07/2011 13:42:03
 
 
To
29/07/2011 13:33:46
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01519607
Message ID:
01519610
Views:
44
>Hello Community.
>
>I recently changed my tables in a program from foxpro to sql 2005 (upsized them)
>
>while i can create remote views fine an all im trying to convert this piece of class code
>
>it used to be
>
>USE datamain.dbc!useracess.dbf
>
>but that cannot work cause im trying to get rid of .dbf
>
>so im trying to use
>
>Handle = SQLStringConnect ("driver={SQL Server};server=HP6PQ8\SQLEXPRESS;database=MYDATA;pwd=;uid=;")
>
>
>USE Datamaia!dbo.useracess.USERACESS CONNSTRING handle
>
>this new code tells me it cannot find "dbo.useracess.USERACESS" in the path of my foxpro program.
>
>1) not sure why thats the path its looking for, shouldnt the connection string deal with the path?

You can't use the USE command with tables on a server. You have to send commands to the server to bring the data into local cursors. For example, if you want to bring the entire UserAccess table into a local cursor (which isn't really a good idea unless the table is quite small), you'd do something like:
IF SQLExec(m.Handle, "SELECT * FROM UserAccess", "UserAccess")
   * Success
ELSE
   * The query failed. You'll need to act appropriately.
ENDIF

* If you were successful, at this point, you have a cursor named UserAccess that you can
* work with. Be careful not to close it, until you're really done with it.
Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform