Connecting Applications to Mysql

------_=_NextPart_001_01C56DA6.2F23F8D4
Content-Type: text/plain

Dear Sir/Madam,

I am VB6 programmer who is new to mysql and would like to know how best to
connect my applications to Mysql.
Especially where to put the connection code in my applications.

Thanks in advace
Bonney.


------_=_NextPart_001_01C56DA6.2F23F8D4--
BONNEY Nat [ Fr, 10 Juni 2005 12:21 ] [ ID #832437 ]

Re: Connecting Applications to Mysql

BONNEY Nat wrote:

>Dear Sir/Madam,
>
>I am VB6 programmer who is new to mysql and would like to know how best to
>connect my applications to Mysql.
>Especially where to put the connection code in my applications.
>
>Thanks in advace
>Bonney.
>
>
>
>
I wrote a couple of pages on that topic a while ago. It's at:
http://entropy.homelinux.org/MySQL/

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak [at] nusconsulting.com.au
website: http://www.nusconsulting.com.au

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc [at] m.gmane.org
Daniel Kasak [ Di, 14 Juni 2005 00:22 ] [ ID #835097 ]

RE: Connecting Applications to Mysql

I use this and it works very well

http://www.vbmysql.com/projects/vbmysqldirect/

The steps you need to get connected are

1. Include a reference to VB MySQL Direct in Project/References
(references vbmysqldirect.dll) for your VB6 project.

2. Connect to MySQL, something like this

Set gCon =3D New MYSQL_CONNECTION
gCon.OpenConnection F.Server, F.User, F.Password, F.Database

3. Then execute queries something like this

Public Function RunSQL(SQL As String) As MYSQL_RS
Dim rs As MYSQL_RS
Dim Cmd As String

Cmd =3D UCase(Left(SQL, 4))
Debug.Print SQL
If Cmd =3D "SELE" Or Cmd =3D "SHOW" Then
' SELECT or SHOW can return a resordset
Set rs =3D gCon.Execute(SQL, gRecordsAffected)
Set RunSQL =3D rs
Else
' An action query, don't worry about recordset
gCon.Execute SQL, gRecordsAffected
End If

With gCon.Error
If .Number <> 0 Then
MsgBox .Description, vbOKOnly + vbExclamation, "RunSQL
Database error"
.Clear
End If
End With
End Function

There are lots of variations on this but this is what I do.

John Bonnett

-----Original Message-----
From: BONNEY Nat [mailto:NBonney [at] iom.int]
Sent: Friday, 10 June 2005 7:52 PM
To: 'myodbc [at] lists.mysql.com'
Subject: Connecting Applications to Mysql

Dear Sir/Madam,

I am VB6 programmer who is new to mysql and would like to know how best
to
connect my applications to Mysql.
Especially where to put the connection code in my applications.

Thanks in advace
Bonney.


--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=3Dgcdmo-myodbc [at] m.gmane.o rg
jbonnett [ Di, 14 Juni 2005 00:53 ] [ ID #836638 ]

RE: Connecting Applications to Mysql

I use Runtime Revolution (http://www.runrev.com) to write to 2 MySQL db's simultaneously (one is MacOSX, the other is Fedora Core 3) for a Department wide production ciritcal app, written in Revolution. Works beautifully. You can download a trial version of Rev here: http://downloads.runrev.com/

I got a jump-start by downloading a sample stack from a user contrubution posted to the RunRev list. Look for the two sample stacks here: http://www.troz.net/Rev/. They are called ySQL.rev.gz and MySQLtests.rev.gz.

Cheers...James

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc [at] m.gmane.org
James Cass [ Di, 14 Juni 2005 20:01 ] [ ID #836639 ]
Datenbanken » gmane.comp.db.mysql.odbc » Connecting Applications to Mysql

Vorheriges Thema: Chiliasp SUM() function error
Nächstes Thema: Establish a DSN to a remote MySQL (Please help-SOS)