Link to home
Start Free TrialLog in
Avatar of megha27
megha27

asked on

database connectivity in visual basic 6.0 with mysql installed on linux server

i am making a project in visual basic 6.0 . how do i proceed with database connectivity with mysql on a linux server? i have never worked on linux before.
thanks ....
Avatar of suprapto45
suprapto45
Flag of Singapore image

I think that VB 6.0 only compatible with non-linux server.
Not sure....wait other people's response :).
Avatar of megha27
megha27

ASKER

see...vb program will be installed on the client machines (using windows) and from there i need to connect to the database. preferably dsn-less connection...coz i'd go half-crazy making dsn on all machines.
I think you can't access the linux database using VB Program with out any DSN.
If you create a DSN, just a matter of creating the connection and you can access whole database through the DSN.
heh.. the database can run on any platform aslong as you have the appropriate API/drivers to do the stuff for you..

it IS possible to use mysql from VB.. you have to install the odbc drivers check mysql site they have the appropriate odbc drivers

what you need is this
http://dev.mysql.com/downloads/connector/odbc/3.51.html

if you have any doubts i can provide you with some code examples...

Enjoy
Pratap
Why u need the database on linux server megha,you first test mysql databse on windows plateform using vb.

if you successful there porting is very easy,try some advance technique like ADO db.

hope this will help
and why you want dsn less conectivity ,please elobrate
Avatar of megha27

ASKER

hey alok...
i want (rather i'd prefer) a dsn-less connectivity because this vb exe has to be installed on more than 50-60 systems and creating dsn on all systems is certainly not my (or anyone else's) idea of fun...but if dsn connectivity is the best bet...then i'll stick with it...
Megha Rampal
Avatar of megha27

ASKER

hi pratap
i've downloaded the mysql odbc driver. if you could send the the sample code...will be very helpful...
thanks
you might want to check the mysql site.. it has a good example... here you go

http://dev.mysql.com/doc/connector/odbc/en/manual.html#MyODBC_With_VB

check the one which is dsn-less

let me know if you have doubts...

Enjoy!
Pratap
ASKER CERTIFIED SOLUTION
Avatar of cool_alok
cool_alok

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
all megha wanted to do was connect to mysql from a vb program.. who knows it could be a distributed server network!! there was no problem at all!!

on a side note.. alok, your representation of the three tier architecture involving the website as a middle layer may not be the best solution....but i do agree with your point that instead of 50 connections to the database a middle data layer may be introduced which will act as an interface between the database and the client application. its your call megha,, this will involve significant code changes though..

Enjoy!
Pratap
Avatar of megha27

ASKER

well i'll have to think on it...the thought of having a  middle data layer is definitely good !!! so many connections will definitely put unnecessary load on the network...
yeah pratap,do u  know today every one is looking forward for webbased solution,and in my opnion it very easy implement and mantain such system as client don't knwo where actual data base is located.


 i too work on same buddy,i am system & network progarmmer and i have deal these type of thing daily,actually i myself used  same technique for creating a network management software.
welcome aboard :-)
I see 2 issues

[Issue 1]
connecting to mysql server on linux or windows
[Answer]
makes no differance we moved from file server model to client  server model to avoide the problems we face woth different filesystems and OS Servers simply respond on Sockets and as long as your Operartting system has some version of Berkley Unix   Socket it shall work.
In our case Windows and Linux has them


[ISSUE 2]
dsn less connection
[ANSWER]
Yes is possible
DSN is just a place to store teh database server login info so to say Server location password and username
Only benifit is if U switch the database server later u just have to change the DSN and the same exe works

[ISSUE 3]
Installing on many Systems
Of course if you want to install on may clients you can create a DSN using VB Codes

[ISSUE 3 B]
Dont want DNS
its possible to create a connection without using a DSN at all you simply have to embed or create and pass the connection string in your data object or class
you havnt told how you plan to access the data assuming its ADO component
om properties
Click the custom  and then build string add the credentials and it shall work

You shall still need to install ODBC driver for mysql on all systems unless you can make it a part of install or config system on your VB project

[ISSUE 4]
If you do not want to add the ODBC driver you can connect to MySql using native codes
download the dll from
http://www.vbmysql.com/

You shall find quiet a few source codes that work out of the box

Have Fun any further queriies Post it here Maybe we can post a sample if you can give more details of your project so to say what approch of all the mentioned ones you like to take.


which country buddy :)
j_chakraverty.. i think the problem is already solved.. :-) the solutions you have suggested have already been suggested in the previous posts..

alok, where else do you think!!!!!
tell me,i am waiting for job offer,you can visit me at http://www.thisisalok.tk
@alok The countrys INDIA The city capital New Delhi
@pratap Sorry i failed to find the solution, similar to mine, that you mentioned on the post prior to mine any way idea was to give additional methods that are possible. Hope to see more intresting ideas Vb with Mysql is a personal favourate of mine.
:-) oops.. i just got confused by your post...
i think megha forget to distribute points