?
Solved

ms access to mysql HELP!

Posted on 2003-02-26
10
Medium Priority
?
176 Views
Last Modified: 2013-06-11
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
Comment
Question by:paulmccartneyjr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
10 Comments
 
LVL 2

Expert Comment

by:AndySulz
ID: 8036564
Are you trying to convert your Access DB to a MySQL DB?
0
 
LVL 2

Expert Comment

by:AndySulz
ID: 8036580
Are you trying to convert your Access DB to a MySQL DB?
0
 

Author Comment

by:paulmccartneyjr
ID: 8037641
yes im trying to do that...
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:paulmccartneyjr
ID: 8037654
and upload the new mysql database to the web server
0
 
LVL 2

Expert Comment

by:AndySulz
ID: 8037952
   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
 
LVL 2

Expert Comment

by:AndySulz
ID: 8037956
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
 
LVL 2

Expert Comment

by:AndySulz
ID: 8037968
change the Server=server to =YourMySQLDBServerIP  make sure you have the required access to the db.
0
 
LVL 2

Accepted Solution

by:
AndySulz earned 800 total points
ID: 8037972
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
 

Author Comment

by:paulmccartneyjr
ID: 8038256
thank you man! thats just what i needed and worked perfeclty fine.

thanks again
0
 
LVL 2

Expert Comment

by:AndySulz
ID: 8038585
thanks for the 'A'
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month9 days, 17 hours left to enroll

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