Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

ms access to mysql HELP!

hi, i need some help on this... i need to upload my ms access database to a web server which has a mysql database from my local computer at runtime with visual basic! is this possible? and how? source code would be very welcome

thanks in advance
0
paulmccartneyjr
Asked:
paulmccartneyjr
  • 7
  • 3
1 Solution
 
AndySulzCommented:
Are you trying to convert your Access DB to a MySQL DB?
0
 
AndySulzCommented:
Are you trying to convert your Access DB to a MySQL DB?
0
 
paulmccartneyjrAuthor Commented:
yes im trying to do that...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
paulmccartneyjrAuthor Commented:
and upload the new mysql database to the web server
0
 
AndySulzCommented:
   Dim db As Database
    Dim rs As Recordset
   
    Set db = OpenDatabase(App.Path & "\db1.mdb")
    Set rs = db.OpenRecordset("Select * from tblCompanies")

    rs.MoveFirst
    While Not rs.EOF
        Convert_tblCompanies rs("CompaniesID        rs.MoveNext
    Wend
   
    rs.Close
    db.Close
0
 
AndySulzCommented:
Public Function Convert_tblCompanies(CompanyID As Long)
    Set adodataconn = New ADODB.Connection
    adodataconn.CursorLocation = adUseClient
    adodataconn.Open "Driver={MySQL ODBC 3.51 Driver};Server=server;Port=3306;Option=132072;Stmt=;Database=DB", "Username", "password"
    Set rsrecordset = New ADODB.Recordset
    rsrecordset.CursorType = adOpenStatic
    rsrecordset.CursorLocation = adUseClient
    rsrecordset.LockType = adLockPessimistic
    rsrecordset.Source = "Select * From tblCompanies Where CompanyID = NULL"
    rsrecordset.ActiveConnection = adodataconn
    rsrecordset.Open
   
    rsrecordset.AddNew
    rsrecordset("CompanyID") = CompanyID
    rsrecordset.Update
   
    rsrecordset.Close
    adodataconn.Close
end function
0
 
AndySulzCommented:
change the Server=server to =YourMySQLDBServerIP  make sure you have the required access to the db.
0
 
AndySulzCommented:
change Convert_tblCompanies rs("CompaniesID        rs.MoveNext

to:
Convert_tblCompanies rs("CompaniesID")
        rs.MoveNext



This is just sample code, you have to change the field names to match your data.
0
 
paulmccartneyjrAuthor Commented:
thank you man! thats just what i needed and worked perfeclty fine.

thanks again
0
 
AndySulzCommented:
thanks for the 'A'
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now