Sir namaskar!
i have created a database on my web space with one table
i want to connect my vfp form to thsi database, so that data can be saved on server and multiple user can access that form
please tell me how to connect my web server database with odbc
THANKS
RAJESH

RAJESH GUPTA13 reputationPosted Dec 26, 2024, 3:17 AM EST
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
Jayraj ChhayaRank #304 · 8.2K reputationPosted Dec 24, 2024, 9:07 AM EST
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:
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.") ENDIFPerform 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.