xxdcmast
04-18-2004, 12:28 PM
Hey I have this code below that I wrote at school and Im trying to transfer it to work on my home system but it wont work. I think it might have something to do with the refferences that I have in the porject. Does anyone know what references I need to install to make this work?
Private Sub Form_Load()
Dim x As Integer
Dim y As String
Dim MyConn As ADODB.Connection
Dim MyRecSet As ADODB.Recordset
Set MyConn = New ADODB.Connection
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\WINNT\Profiles\lab-208sn\Desktop\TISCustomers.mdb;"
MyConn.Open
x = Form2.Text1.Text
y = Form2.Text2.Text
Set MyRecSet = MyConn.Execute("SELECT Balance FROM Customers where Pin = " & x & " and Account = '" & y & "'")
Do Until MyRecSet.EOF
strBalance = MyRecSet("Balance")
lstData.AddItem strBalance
'Puts the data into a list file
Text1.Text = strBalance
'puts the data into textbox
MyRecSet.MoveNext
Loop
MyConn.Close
End Sub
Private Sub Form_Load()
Dim x As Integer
Dim y As String
Dim MyConn As ADODB.Connection
Dim MyRecSet As ADODB.Recordset
Set MyConn = New ADODB.Connection
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\WINNT\Profiles\lab-208sn\Desktop\TISCustomers.mdb;"
MyConn.Open
x = Form2.Text1.Text
y = Form2.Text2.Text
Set MyRecSet = MyConn.Execute("SELECT Balance FROM Customers where Pin = " & x & " and Account = '" & y & "'")
Do Until MyRecSet.EOF
strBalance = MyRecSet("Balance")
lstData.AddItem strBalance
'Puts the data into a list file
Text1.Text = strBalance
'puts the data into textbox
MyRecSet.MoveNext
Loop
MyConn.Close
End Sub