faqts : Computers : Programming

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

24 of 41 people (59%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

How to connect a form of vb to a remote SQL database through Internet?

Oct 19th, 2006 18:01
Chad Currie, Hossam Hossny, Rachit Bagda, Subhasis Roy, http://www.globalweb.com.ru, http://www.blogvoid.com/category/mysql/


Use this sample code..
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Trusted_Connection=yes;driver=SQL 
Server;server=yourserver;database=yourdatabase;"
If you are connecting to a remote mysql server, I would suggest using 
MySQL Connector ODBC which you need to install from 
http://www.mysql.com/products/connector/odbc/
After you install that on your computer you can connect to a mysql 
server through visual basic using this connection string.
'connect to MySQL server using MySQL ODBC 3.51 Driver
Set conn = New ADODB.Connection
conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};"_
& "SERVER=localhost;"_
& " DATABASE=test;"_
& "UID=venu;PWD=venu; OPTION=3"
conn.Open
Hossam Hossny
Free Web Hosting, PHP, mySQL and more...
50 MB web space, 1 GB monthly transfer
http://www.globalweb.com.ru