Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP ODBC driver
Message
From
04/12/2006 16:06:10
 
 
To
04/12/2006 14:55:09
General information
Forum:
Visual FoxPro
Category:
Installation, Setup and Configuration
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01174716
Message ID:
01174748
Views:
10
I'm not sure I understand. Are you querying SQL Server or a VFP table? If SqlServer, can you post your code? This works for me:
CLOSE ALL
CLEAR ALL
RELEASE ALL
CLEAR

* In this example I use windows authentication to connect to sql server (not sql server auth):
* The server is my destkop and my computer's name is myDesktop
* The sql server is mysqlrms
* The table in mysqlrms is occ_main
* The field I am updating is name based on the key field of occ_main.occup_id = '1STH001'

_sSqlConnStr = "DRIVER=SQL Server;SERVER=myDesktop;database=mysqlrms"
WAIT WINDOW "Connecting..." NOWAIT
lnHan = SQLSTRINGCONNECT(_sSqlConnStr)
WAIT CLEAR
? [Handle: ] +ALLTRIM(STR(lnHan))
IF lnHan > 0
	lnokay=SQLSETPROP(lnHan,'Transactions',2)
	lnokay=SQLEXEC(lnHan,"Select * from occ_main WHERE occup_id LIKE '1stH0001'",'sqlresult')
	SELECT sqlresult
	IF lnokay > 0
		SELECT sqlresult
		BROWSE
	ENDIF
	lnokay=SQLEXEC(lnHan,"Update occ_main SET name = 'My Name' WHERE occup_id LIKE '1STH0001'")
	IF lnOkay <> 1
		?[Errors: ]
		? AERROR(errors)
	ELSE
		?[Update Ok.]
	ENDIF
	lnokay=SQLEXEC(lnHan,"Select * from occ_main WHERE occup_id LIKE '1stH0001'",'sqlresult')
	IF lnokay > 0
		SELECT sqlresult
		BROWSE
	ELSE
		?[Unable to query occ_main again.]
	ENDIF
	IF SQLDISCONNECT(lnHan) = 1
		? [Disconnected.]
	ELSE
		? [Error disconnecting.]
	ENDIF
ELSE
	? [ Unable to connect. ]
ENDIF
RETURN
>I am trying to setup an data source to get VFP data using a SQL-Server linked server.
>When I choose "Microsoft Visual Foxpro Driver" when creating the data source, I get:
>"You must first install the current veriosn of the Visual FoxPro ODBC Driver. Go to http://msdn.microsoft.com/vfoxpro/downloads. Select product updates, then Visual FoxPro ODBC Driver. I downloaded it, installed it and when I try to choose the VFP driver, I get the same message. I've tried this on two computers. Any know the solution?
>TIA - Mark
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform