473,387 Members | 3,684 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to connect to mySQL data base from my pc

Hi!

I've got an VisualBasic application that I want to connect to an mySql
database over det Internett, how do I do this? My app. is going to insert
data into my mySql database on the server to where I'm hosting my Website.
Must my webhost have to install ODBC on the mySql database?

Regards, Sigurd!
Jul 17 '05 #1
3 1928
On Fri, 6 Feb 2004 20:25:10 +0100, "Sigurd Friisvold" <si****@friisdata.com>
wrote:
I've got an VisualBasic application


Why are you posting to a PHP newsgroup?

Try one of the microsoft.public.* groups.

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
Jul 17 '05 #2
MySQL provide a windows ODBC driver on their website www.mysql.com. You can
then connect to the database via that ODBC driver using ADO, there are some
code examples on www.planetsourcecode.com.

Hope this helps.

Jasper.
Jul 17 '05 #3
Here's some code I wrote recently that might help you do the job. Replace
addresses, usernames and passwords with your own server and add latest ADO
library as a reference in VB project. This one checks that a username and
password exists/is correct.

---------------------------------------------------------

Public REMDBOBJ As ADODB.Connection 'Remote Connection To ADODB.
Public REMRSOBJ As ADODB.Recordset 'Holds Remote Records.

Public Sub ConnectRemDB()
' This Function Connects To The Remote SQL Database.

'Creates A New Connection Object.
Set REMDBOBJ = New ADODB.Connection

'Creates A New Recordset Object.
Set REMRSOBJ = New ADODB.Recordset

' Sets Location Of Cursor Services To Clientside.
REMRSOBJ.CursorLocation = adUseClient
REMDBOBJ.CursorLocation = adUseClient

' Opens Connection To Mobdecs Local Database.
REMDBOBJ.Open "Driver={MySQL ODBC 3.51
Driver};server=sql.address.com;uid=userhere;pwd=pa sshere;database=dbhere"

' Authenticate User.
REMDBSQL = "SELECT * FROM Users WHERE `Username`='" &
Main.TXTUsername.Text & "'"
REMRSOBJ.Open REMDBSQL, REMDBOBJ, adOpenKeyset, adLockPessimistic

' Check Username/Password
If REMRSOBJ.RecordCount = "0" Then
Call MsgBox("Your Username Was Not Found.", vbOKOnly,
"Authentication Error")
ElseIf REMRSOBJ!Password <> Main.TXTPassword.Text Then
Call MsgBox("Your Password Was Not Accepted.", vbOKOnly,
"Authentication Error")
Else
' Do Something If Autenticated.
End If

' Close Record Set.
REMRSOBJ.Close

' Destroy Objects.
Set REMRSOBJ = Nothing
Set REMDBOBJ = Nothing

End Sub

-----------------------------------------------------

Regards, Jasper
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Mr Dygi | last post by:
Hi, PHP 4.3.4 installed manually from package *.zip and Apache 2. I have a problem with this simple code: <?php $link = mysql_connect("127.0.0.1","","") or die("Could not connect: " ....
3
by: Neo | last post by:
It's really strange. I downloaded the latest 4.0.16 RPM from mysql.com and installed it to my Fedora system, and did *not* do anything else (Actually I am completely new to mysql). I wrote a...
0
by: Bill Hernandez | last post by:
Hi, I've been writing software on the mac since 1987, but am brand new at unix/php/mysql, and that's where I'm headed so I'm reading everything I can get my hands on, but like anything else...
2
by: Brett B | last post by:
I just installed mysql on linux. If I open a terminal, su to root, then type "mysql", I am able to connect to the server and run my queries. If I exit out of su so that I am my own id (baisley)...
6
by: AP | last post by:
I have not seen any good examples on how to connect to a mySQL db. My website uses phpMyAdmin to administer the SQL databases. What confuses me is where are the databases that I create located? For...
2
by: zMisc | last post by:
I am using VB.NET 1.1 and cannot connect to a MySQL (v5) database. I've done the following: 1) Create a DSN for MyODBC. 2) Connect using: Driver=MySQL ODBC 3.51 Driver; Server=localhost; Data...
3
by: nandhanvijay | last post by:
hi every am trying to connect data base in vb.net but am unable to connect. As per the book am following that says to connect to data base go to tools menu connect to data base option. u will...
3
by: arasub | last post by:
ep 20, 2007 11:25:57 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found...
2
by: swarajtnj | last post by:
Hi Friends, I am using MySql 5.0. With the Front end as ASP.NET 2.0. I am working a small concern. my company local server to connect the MySql is perfectly working. But when i Connect to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.