1
Thanks for reply
i do as instructed but unable to connet
when i press test buttion windows disapper
i using my sql data baee on web server
which ODBC shold i install on my loca compuer
is there any possibility that i can connect web server data bssewith creating DSN in loca computer
THANLS
0
Hi RAJESH GUPTA,
To connect your Visual FoxPro (VFP) form to a web server database using ODBC, follow these steps:
-
Install ODBC Driver: Ensure you have the appropriate ODBC driver installed for your database type (e.g., MySQL, SQL Server).
-
Create ODBC Data Source:
- Open the ODBC Data Source Administrator on your machine.
- Click on the "System DSN" tab and then "Add".
- Select your database driver and configure the connection settings, including the server address, database name, user credentials, and any other required parameters.
-
Connect from VFP: Use the following SQL command in your VFP form to establish the connection:
-
LOCAL lnConnHandle
lnConnHandle = SQLCONNECT("YourDSNName", "username", "password")
IF lnConnHandle > 0
* Connection successful
=SQLDISCONNECT(lnConnHandle)
ELSE
* Handle connection error
MESSAGEBOX("Connection failed.")
ENDIF
-
Perform Database Operations: Once connected, you can execute SQL commands to insert, update, or retrieve data from the web server database.
By following these steps, you can successfully connect your VFP form to a web server database, allowing multiple users to access and manipulate data efficiently.
