Someone please help.
Im trying to connect attachmate to a database. open a table and have attachmate loop through the records, obtain some info from each account and then write it back into a field in the database. But i cant work it out. This is what ive got so far.
Sub Main()
Dim Sys As Object, Sess As Object
Dim conn As Object, rs As Object, D_Base As String, FBRef As String
Dim C_Name As String
Set Sys = CreateObject("Extra.System")
Set Sess = Sys.ActiveSession
Set conn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
Dim AddLineInfo
D_Base = "C:\E_G_U.mdb"
FBRef = "Select FBRef from tblMain;"
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & D_Base
rs.Open "tblMain", conn
Do Until rs.EOF
Sess.Screen.Sendkeys("<Pf24>")
Sess.Screen.WaitHostQuiet(g_HostSettleTime)
Sess.Screen.Sendkeys("<Home>post")
Sess.Screen.PutString rs.Fields("FBRef"), 09, 23
Sess.Screen.Sendkeys("<Enter>")
rs.Fields("Name") = Sess.Screen.GetString(02,02,36)
Sess.Screen.WaitHostQuiet(g_HostSettleTime)
rs.MoveNext
Loop
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
Set Sess = Nothing
Set Sys = Nothing
End Sub
Im thinking that <Set rs = CreateObject("ADODB.Recordset")> is the problem and that i should be linked directly to the database.
Ambition..........If you dont use it, you wont lose it
Im trying to connect attachmate to a database. open a table and have attachmate loop through the records, obtain some info from each account and then write it back into a field in the database. But i cant work it out. This is what ive got so far.
Sub Main()
Dim Sys As Object, Sess As Object
Dim conn As Object, rs As Object, D_Base As String, FBRef As String
Dim C_Name As String
Set Sys = CreateObject("Extra.System")
Set Sess = Sys.ActiveSession
Set conn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
Dim AddLineInfo
D_Base = "C:\E_G_U.mdb"
FBRef = "Select FBRef from tblMain;"
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & D_Base
rs.Open "tblMain", conn
Do Until rs.EOF
Sess.Screen.Sendkeys("<Pf24>")
Sess.Screen.WaitHostQuiet(g_HostSettleTime)
Sess.Screen.Sendkeys("<Home>post")
Sess.Screen.PutString rs.Fields("FBRef"), 09, 23
Sess.Screen.Sendkeys("<Enter>")
rs.Fields("Name") = Sess.Screen.GetString(02,02,36)
Sess.Screen.WaitHostQuiet(g_HostSettleTime)
rs.MoveNext
Loop
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
Set Sess = Nothing
Set Sys = Nothing
End Sub
Im thinking that <Set rs = CreateObject("ADODB.Recordset")> is the problem and that i should be linked directly to the database.
Ambition..........If you dont use it, you wont lose it