Solved

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

Posted on 2004-10-13
22
2,925 Views
Last Modified: 2010-08-05
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 ....
0
Comment
Question by:megha27
  • 7
  • 6
  • 4
  • +3
22 Comments
 
LVL 16

Expert Comment

by:suprapto45
ID: 12295858
I think that VB 6.0 only compatible with non-linux server.
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 12295866
Not sure....wait other people's response :).
0
 

Author Comment

by:megha27
ID: 12295922
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.
0
 
LVL 2

Expert Comment

by:suthagarank
ID: 12296700
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.
0
 
LVL 11

Expert Comment

by:pratap_r
ID: 12297056
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
0
 
LVL 1

Expert Comment

by:cool_alok
ID: 12297581
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
0
 
LVL 1

Expert Comment

by:cool_alok
ID: 12297594
and why you want dsn less conectivity ,please elobrate
0
 

Author Comment

by:megha27
ID: 12298795
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
0
 

Author Comment

by:megha27
ID: 12298815
hi pratap
i've downloaded the mysql odbc driver. if you could send the the sample code...will be very helpful...
thanks
0
 
LVL 11

Expert Comment

by:pratap_r
ID: 12299353
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
0
 
LVL 1

Accepted Solution

by:
cool_alok earned 125 total points
ID: 12305071
but my opinion the problem will remain the same,when 50 to 60 client accessing same database why not go for web based solution for handling this problem .

 let me explain
 
database ----------- >Web Site--------------------->VB Client(via wininet querry strings)
              <-----------               <--------------------
                 query                      via post and get method.

  This is what we call three tier achitecture and advantage now you can load thousand of you client at different /remote position
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 11

Expert Comment

by:pratap_r
ID: 12305567
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
0
 

Author Comment

by:megha27
ID: 12306027
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...
0
 
LVL 1

Expert Comment

by:cool_alok
ID: 12306928
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.
0
 
LVL 11

Expert Comment

by:pratap_r
ID: 12307668
welcome aboard :-)
0
 
LVL 1

Expert Comment

by:j_chakraverty
ID: 12313919
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.


0
 
LVL 1

Expert Comment

by:cool_alok
ID: 12316126
which country buddy :)
0
 
LVL 11

Expert Comment

by:pratap_r
ID: 12316448
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!!!!!
0
 
LVL 1

Expert Comment

by:cool_alok
ID: 12316679
tell me,i am waiting for job offer,you can visit me at http://www.thisisalok.tk
0
 
LVL 1

Expert Comment

by:j_chakraverty
ID: 12323364
@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.
0
 
LVL 11

Expert Comment

by:pratap_r
ID: 12326502
:-) oops.. i just got confused by your post...
0
 
LVL 1

Expert Comment

by:cool_alok
ID: 12357144
i think megha forget to distribute points
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A short article about problems I had with the new location API and permissions in Marshmallow
If you don't know how to downgrade, my instructions below should be helpful.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now