2

I have a access database. The database have a table. Table contain several fields including url field. I have created a form to migrate ms access data to oracle. Then I added a button to save data to the oracle. But before saving the url , some of the characters needed to be replaced by proper characters.

Private Sub Command59_Click()

    accesstableDataSet = currentAccessSheet.gettable('tableToMigrate')
    foreach ( record in accestableDataSet){
        rowUrl = record.url
        url = doencode(rowUrl)
        exportToMysql(url)

}

How can i do something like above by writing to a access form button ?

Jonathan Nixon
  • 4,940
  • 5
  • 39
  • 53
rinjan
  • 550
  • 5
  • 19

1 Answers1

0

I don't like DAO. I like ADO ;) even if there are some limitations in MS Access, ADO provides access to a broader variety of data sources than DAO, and exposes some features of the Jet 4.0 database engine that aren't available from DAO.

Dim rst As ADODB.Recordset
Dim sSQL AS String, sUrl AS String

sSQL = "SELECT *" & vbCr & _
    "FROM TableToMigrate"
Set rst = New ADODB.Recordset
rst.Open sSQL, CurrentProject.Connection, adOpenStatic
With rst
    'fill rst object
    .MoveLast
    .MoveFirst
    'proccess through the
    Do While Not rst.EOF
        'get Url and decode it
        sUrl = DecodeUrl(.Fields("Url"))
        ExportToMySQL(sUrl)
        .MoveNext
    Loop
    .Close
End With

I assume that you know how to write DecodeUrl and ExportToMySQL functions/procedures ;)

Maciej Los
  • 8,468
  • 1
  • 20
  • 35