Code worked at school now it doesnt

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;"

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



End Sub

04-18-2004, 12:33 PM
I suspect it's the Database components.

Download and install the last MDAC_TYP.exe and Jet40Sp8_Comp.exe from MS. You can probably get them from

04-18-2004, 12:34 PM
says cant find project or library that sound like the two things u just mentioned?

04-18-2004, 12:36 PM

04-18-2004, 12:37 PM
ok dl now and as far as the refferences go do i need to choose any?

04-18-2004, 12:40 PM
Well, provided you didn't save the project when you loaded it and it errored then no, the references should still be there. If however you saved it then you will need to re-reference the libraries that your referenced when you created the project at school.

04-18-2004, 12:59 PM
Ok I dl those but neither worked. I checked the refferences and found that my system is missing
Microsoft activex data objects 2.7 library and
microsoft activex data objects recordset 2.7 library

any idea where I can get these?

04-18-2004, 01:18 PM
As I understand it, those are part of MDAC. You said you downloaded them. I assume you installed them too.

04-18-2004, 01:25 PM
Totally agree with Banjo; I assume you probably have a lesser version, say 2.6 or 2.5; goto to MSDN ( & search for MDAC.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum