List:General Discussion« Previous MessageNext Message »
From:Ben Joyce Date:September 6 2002 4:49pm
Subject:RE: mysql connection with VB
View as plain text  
If you're in VB and want to connect to a mySQL database then why not use
myODBC? it's what it's there for.

A simple connection string would be:

	strConnectionString="DRIVER={MySQL}; SERVER=server;
DATABASE=database; UID=username; PWD=password;"

To access and manipulate the data use ADO:

	dim cnnConnection as adodb.connection
	set cnnConnection = new  adodb.connection

	cnnConnection.open strConnectionString

	if err <> 0 or cnnConnection.State <> 1 then

		'error handling

	end if

	'do database stuff
	
	cnnConnection.Close
	set cnnConnection = nothing

hth,

 .ben

> -----Original Message-----
> From: Marcelo Miorelli - ProCAD [mailto:miorelli@stripped] 
> Sent: 06 September 2002 17:36
> To: mysql@stripped
> Subject: mysql connection with VB
> 
> 
> Hi list,
> I am developing a program in visual basic, ans as I am brand 
> new to mysql
> database, I would like to know from you which are the proper 
> ways to access
> the database from my vb program. I know there could be using 
> odbc, but I
> would rather not to use it at all.
> 
> We´re working for windows, but I am pretty inclined to start 
> with the Linux
> as sson as possible. In some months I believe our server will 
> be running
> Linux with Samba.
> 
> Hope you are well,
> thanks in advance,
> 
> Marcello Miorelli
> 
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <mysql-thread118967@stripped>
> To unsubscribe, e-mail 
> <mysql-unsubscribe-ben=babelfish.co.uk@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 

Thread
mysql connection with VBMarcelo Miorelli - ProCAD6 Sep
  • RE: mysql connection with VBBen Joyce6 Sep
  • Re: mysql connection with VBGelu Gogancea6 Sep