Urgent HELP!!!!
Posted by: Francis Flores
Date: December 01, 2009 08:44PM

hi guys. can you please check my codes..

i am currently working on a migration of a foxpro to a mysql database
but i have an error when i am executing my insert query. help me out. :)

''''''''''''''''''''start of SUB
Dim myConnection As New MySqlConnection
Dim foxConnection As New OleDbConnection

Dim test1 As String = "z:\foxpro\" 'where resides the foxpro table

myConnection = New MySqlConnection("SERVER=" & My.Settings.DBSERVER & ";" _
& "DATABASE=testdata;" _
& "UID=user;" _
& "PWD=pass;")


Dim xFoxpro As String = "select strtran(dept_code,chr(39),'') as dept_code, strtran(desc,chr(39),'') as descr from dept"

Dim strSql As String = "insert into dept " & xFoxpro

Dim connCommand As New MySqlCommand
connCommand.CommandText = strSql & " Provider=VFPOLEDB;" + _
"Data Source= " & test1 & " ;" & _
"Collating Sequence=general;"

connCommand.Connection = myConnection
If connCommand.Connection.State <> ConnectionState.Open Then
connCommand.Connection.Open()
End If
connCommand.ExecuteNonQuery()

''''''''''''''''''''end of SUB

Options: ReplyQuote


Subject
Views
Written By
Posted
Urgent HELP!!!!
8976
December 01, 2009 08:44PM
3798
December 20, 2009 10:55AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.