Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Kathy Tremblay
  Where is Kathy Tremblay?
 MontrĂ©al
 Canada
 Kathy Tremblay
 Tags
Subject: Cannot open the file ???
Thread ID: 33668 Message ID: 33668 # Views: 1 # Ratings: 0
Version: FoxPro 2.x for Windows Category: Databases, Tables and SQL Server
Date: Monday, December 01, 2003 4:07:02 PM         
   



I'm not a specialist in FoxPro so i just need some help for how to connect my existing program FOXPRO 2.6 to Database on SQL Server ?

Please someone can help me ?

MY ERROR WHEN I DO...

FILE "FPSQL.PRG" does not exist.

MY CODE:

SET LIBRARY TO FPSQL

*-- Establish a connection
lhHandle = DBConnect("DataSQL","sa","mypassword")


lnErrVal = 0
lcErrMsg = ''
lcSourceName = "DataSQL"
lcUser = "sa"
lcPasswd = "mypassword"

@ 1,2 SAY "Input Password: " GET lcPasswd
READ

lcConnStr = "Westtest"
lhHandle = DBConnect(lcSourceName,lcUser,lcPasswd,lcConnStr)

IF lhHandle > 0 && Successfully Connected
WAIT WINDOW "Successfully Connected"
ELSE
lnError = DBError(0,@lcErrMsg, @lnErrVal)
CLEAR
@ 2,2 SAY lnErrVal
@ 3,2 SAY lcErrMsg
ENDIF

errval = 0
errmsg = ""

retcode = DBExec(handle,"SELECT * FROM ACCOUNT","cursor")
IF retcode > 0
BROWSE
ELSE
error = DBError(handle,@errmsg,@errval)
CLEAR
@ 2,2 SAY errval
@ 3,2 SAY errmsg
ENDIF


Kathy

ENTIRE THREAD

Cannot open the file ??? Posted by Kathy Tremblay @ 12/1/2003 4:07:02 PM
RE: Cannot open the file ??? Posted by Eric den Doop @ 12/1/2003 4:19:13 PM
RE: Cannot open the file ??? Posted by Kathy Tremblay @ 12/1/2003 4:28:32 PM
RE: Cannot open the file ??? Posted by Eric den Doop @ 12/1/2003 4:54:20 PM
RE: Cannot open the file ??? Posted by Kathy Tremblay @ 12/1/2003 5:04:31 PM
RE: Cannot open the file ??? Posted by Andy Rice @ 12/3/2003 7:27:38 PM