Hi,
When i run my program and go to my add new record page, i get runtime error
'3706'. I know it has something to do with the connection to the database but
everything i have tried has not worked. I am using VB6 with an access97
database. This is the bit of code that it debug's:
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0.8618.0;" &
"DataSource=c:my documents\Audit.mdb
cn.Open
Could anyone help at all??
Argusy - 12 Feb 2007 11:19 GMT
More info
are you using the same code work elsewhere, but works?
are you opening multiple pages?
Did a google or MSDN search show up fixes that didn't work?
That sort of thing.
what is the everything in
"but everything I have tried has not worked"
Argusy
> Hi,
>
[quoted text clipped - 8 lines]
>
> Could anyone help at all??
baked potato - 12 Feb 2007 11:55 GMT
Im opening one 1 page (audit records), and 1 table form my database.
'Everthing' meant that i have checked google and msdn and tried their
solutions, which were to change the version of the Microsoft Jet OLEDB but
that didnt work. Unfortunately i do not have the code anywhere else as i am
relatively new to VB coding. Would it help to show you my code for the page??
Henning - 12 Feb 2007 14:43 GMT
> Hi,
>
[quoted text clipped - 8 lines]
>
> Could anyone help at all??
You are using Dim cn As ADODB.Connection
And Set cn = New ADODB.Connection
Try using only Microsoft.Jet.OLEDB.4.0 without subrevisions
/Henning
Paul Clement - 12 Feb 2007 15:07 GMT
¤ Hi,
¤
¤ When i run my program and go to my add new record page, i get runtime error
¤ '3706'. I know it has something to do with the connection to the database but
¤ everything i have tried has not worked. I am using VB6 with an access97
¤ database. This is the bit of code that it debug's:
¤
¤ cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0.8618.0;" &
¤ "DataSource=c:my documents\Audit.mdb
¤ cn.Open
¤
¤ Could anyone help at all??
There is no such provider. It should simply be Microsoft.Jet.OLEDB.4.0.
In addition, "DataSource" should be two words.
Paul
~~~~
Microsoft MVP (Visual Basic)
Henning - 12 Feb 2007 17:23 GMT
> Hi,
>
[quoted text clipped - 8 lines]
>
> Could anyone help at all??
And your file path will fail if it's not a subdirectory of your current
path. Guess you intended c:\my documents\Audit.mdb.
This makes me think you didn't Copy/Paste actual code.
/Henning
karim - 23 Feb 2007 21:33 GMT
IF YOU ARE USING ADO WITH VB6
AFTER DECLARING THE NEW CONNECTION AND THE NEW RECORD SET YOU MUST OPEN THE RECORDSET LIKE THIS:
Recordset.OPEN "SELECT * FROM........." ,connection_name ,ADOPENDYNAMIC , ADLOCKOPTIMISTIC
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
karim - 23 Feb 2007 21:38 GMT
IF YOU ARE USING ADO WITH VB6
AFTER DECLARING THE NEW CONNECTION AND THE NEW RECORD SET YOU MUST OPEN THE RECORDSET LIKE THIS:
Recordset.OPEN "SELECT * FROM........." ,connection_name ,ADOPENDYNAMIC , ADLOCKOPTIMISTIC
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com