Reply
Old January 14th, 2005 Top | #1
 
disavowed00's Avatar
OSNN Junior Addict
Joined: January 2004
Posts: 7
Reputation: 0
Power: 102

Unhappy VB 6 and mySQL

I want to connect a mySQL database to a VB program. mySQL is running on my host machine. The problem is that I'm nt sure what to use for the server name in the connection string. I am very new at this (2 days) so I need a little help. I tried using myodbc but it just gives me an error.
Things I need to know:
1) What do I use for the server name in the connection string
2) I did not set up a password for mySQL so what do I use for the user name

3) If there is an easier way to do this then please tell me.

Also, I am using ado controls
disavowed00 is offline   Reply With Quote
Old January 14th, 2005 Top | #2
 
RickyC's Avatar
OSNN Addict
Joined: September 2004
Location: Earth
Posts: 199
Reputation: 110
Power: 96

Default

1. Server name is the name of the host machine mysql is installed on (computer name).

2. You need to set a username & password using the mysql admin tool to gain access/set privliges to your database.

3. This is the simplest way I can think of!
RickyC is offline   Reply With Quote
Old January 14th, 2005 Top | #3

OSNN Folding Team  
Geffy's Avatar
OSNN Veteran Addict
Joined: March 2002
Location: United Kingdom
Posts: 7,805
Reputation: 1490
Power: 217

Default

as long as mysql is on your localhost machine then you can refer to it as "localhost" if you run mysql.exe (assuming you are on windows) then you need to create a database, switch to it and then create the tables you need
you will also need to add some users to it. I think there are probably some windows gui applications that you can use to set things like that up.


blogtumbloglastfmflickr#rubyonrails@twitter
"I could be replaced with a very small shell script"
Geffy is offline   Reply With Quote
Old January 14th, 2005 Top | #4
 
disavowed00's Avatar
OSNN Junior Addict
Joined: January 2004
Posts: 7
Reputation: 0
Power: 102

Default

I have set priveleges and access. VB still can't find the server on my local machine. I have tried using localhost as the server name and the computer name itself. Niether works!

Thanks for the help so far, but it still doesn't work.
disavowed00 is offline   Reply With Quote
Old January 15th, 2005 Top | #5

OSNN Folding Team  
fitz's Avatar
XPista7eopard*ix
Joined: April 2004
Location: Chicagoland
Posts: 4,028
Reputation: 2947
Power: 168

Default

What is your connection string look like? (obviously feel free to change the username/password before you post here...)

Also.. try looking here: http://forum.qbasicnews.com/archive/...vb6-mysql.html

or here:
http://bugs.mysql.com/bug.php?id=4437

for some examples on connection strings..

You state that you are 2 days new at this.. which this? Programing VB? ADO/DB connections? mySQL/DB administration?
fitz is offline   Reply With Quote
Old January 15th, 2005 Top | #6
 
disavowed00's Avatar
OSNN Junior Addict
Joined: January 2004
Posts: 7
Reputation: 0
Power: 102

Default

thanks for the help guys. Turns out the myodbc driver is a piece of junk. I had to download an archived version and now it works.
disavowed00 is offline   Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules

Similar Threads
Thread Thread Starter Forum Replies Last Post
pg to mysql and mysql to pg Dark Atheist Green Room 9 March 25th, 2008 4:43pm
MYSQL Replication? Eagle710 Linux & BSD 2 December 3rd, 2007 6:56pm
sorting mySQL jimi_81 Web Design & Coding 5 May 6th, 2005 12:36am
PHP and Mysql luish Web Design & Coding 7 August 24th, 2003 6:27pm
PHP MySQL 5meg Web Design & Coding 3 February 2nd, 2002 1:34pm