Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Upload to SQLServer
Message
 
To
04/12/2008 15:12:08
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01365523
Message ID:
01365538
Views:
18
>>>Is it possible to use VFP code to upload data into a SQL Server Express table? Does anyone have a sample script to do this?
>>>Thanks
>>
>>You can handle Express edition as you handle other editions "Standard, Enterprise, etc"
>>There is NO difference between them in VFP point of view.
>>You set a connection, do something (run a query to get result, insert/delete/update some data)
>>
>>So, if you know how to do this in other editions, you are fine with Express also.
>
>Thanks Borislav.
>Its a big assumption to suggest I know how to do it in other editions. Here is my attempt to connect and EXTRACT data. (I figure that if I can get it out then I can also put it in.)
>
>lnHandle = sqlconnect("trpSurvey")
>	
>text to lcSQL textmerge noshow pretext 15
>	select * 
>	from userValidation
>endtext	
>
>if sqlexec(m.lnHandle,lcSQL,"crsImport",aCountInfo) < 0
>	aerror(laError)
>	messagebox(laError[1,2])
>endif
>
>sqldisconnect(m.lnHandle)
>select crsImport
>browse
>But I get an error that says userValidation is an invalid object name. It IS the name of the table and the connection is good. Is there another way to refer to the table?
>Thanks


What is trpSurvey?
I suppose it is DSN or Connection stored in your database.
So are you sure it is connected to right Database or server?
What you get from this:
lnHandle = sqlconnect("trpSurvey")
IF lnHandle > 0
   TEXT TO lcSQL NOSHOW
        SELECT @@SERVERNAME AS SrvName, DB_NAME() AS DbName
   ENDTEXT
   if sqlexec(m.lnHandle,lcSQL,"crsImport",aCountInfo) < 0
      aerror(laError)
      messagebox(laError[1,2])
   ELSE
      BROWSE NORMAL
   endif
   sqldisconnect(m.lnHandle)
ELSE
   aerror(laError)
   messagebox(laError[1,2])
ENDIF
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