Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MyFirstSQL
Message
From
30/07/2011 18:14:57
 
 
To
30/07/2011 17:03:50
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
MySQL
Miscellaneous
Thread ID:
01519710
Message ID:
01519712
Views:
48
I use SQLStringConnect, you need to know the username, password, ip address and port.
lnConnection = SQLSTRINGCONNECT("DRIVER={MySQL ODBC 5.1 Driver};" + ;
			"UID=root;" + ;
			"PWD=password;" + ;
			"server=192.168.0.100;" + ;
			"port=3333")
=SQLSETPROP(lnConnection,'ConnectTimeOut',0)
=SQLSETPROP(lnConnection,'QueryTimeOut',0)
=SQLSETPROP(lnConnection,'ConnectTimeout',0)
=SQLSETPROP(lnConnection,'IdleTimeOut',0)
=SQLSETPROP(lnConnection,'QueryTimeOut',0)
Then you can use SQLEXEC to do the SQL statements:
=SQLEXEC(lnConnection,"CREATE DATABASE MyDatabase;")
=SQLEXEC(lnConnection,"Use MyDatabase;")
=SQLEXEC(lnConnection,"CREATE TABLE NewTable (Field1 Character(10))")
=SQLEXEC(lnConnection,"Describe NewTable")
=SQLEXEC(lnConnection,"Insert into NewTable (Field1) VALUES ('test')")
=SQLEXEC(lnConnection,"SELECT * FROM NewTable")
You need to install the ODBC driver before you can create the connection, and the user root must accept connections from your IP.


>Hi friends.
>
>Today I was bored and I tried to include a Database and a table in it on my pauper web site. I did it. Now I'd like to use it but I don't know how.
>
>First I have to connect it. Anyone can tell me the basic steps to get that?
>
>Mi intention is upload data for my clients.
>
>It's a MySQL database.
>
>Thank you
>
> Héctor
Christian Isberner
Software Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform