Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Extracting data from MDB to SQL 2000
Message
 
To
26/09/2005 04:53:01
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01052928
Message ID:
01052951
Views:
12
This message has been marked as the solution to the initial question of the thread.
>Hi Jon,
>
>I've tried the OPENROWSET of SQL and it worked!... I tried it in query analyzer but could'nt make it work in vfp.
>
>I've tried using sqlexec but won't work. Please help...
>
>Thanks in advance...

Mike,
Copy your query from Query analyzer,
In VFP do:
m.lhSQL = SQLSTRINGCONNECT(".....") && Connection string to SQL Server
IF m.lhSQL < 0
   AERROR(laError)
   MessageBox("Can not connect to SQL Server. Reason: "+laError[1,2])
   RETURN
ENDIF

TEXT TO m.lcSQLStatement NOSHOW
    *** Here paste the copied query from Query analyzer
ENDTEXT

IF SQLEXEC(m.lhSQL, m.lcSQLStatement) < 0
   AERROR(laError)
   MessageBox("Can not execute SQL Statement. Reason: "+laError[1,2])
ENDIF
SQLDISCONNECT(m.lhSQL)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform