Need help with ADO connection

Need help with ADO connection

Post by Philip Pric » Mon, 31 Jul 2000 04:00:00



Can someone tell me what the heck is wrong with the code below? I keep
getting an "Datasource name not found and no default driver specified". I
have tried every damn way I can think of to be able to use App.Path to my
database but I keep getting this error. If I go with the wizard which set's
a fixed path then everything works fine but I don't want a fixed path.
Thanks

Dim db As ADODB.Connection
    Dim rs As ADODB.Recordset
    Set db = New ADODB.Recordset
    db.Provider = "Microsoft.jet.OLEDB.4.0"
    db.Open App.Path & "\Scheduling.mdb", "admin", ""
        Connectstring = "Provider=" & _
        "Microsoft.jet.OLEDB." & _
        "4.0;data source=" & _
        App.Path & "\Scheduling.mdb"

 
 
 

Need help with ADO connection

Post by Tom Gilme » Mon, 31 Jul 2000 04:00:00


Dim db As ADODB.Connection           <===============
    Dim rs As ADODB.Recordset
    Set db = New ADODB.Recordset    <===============

Doesn't look good! Do you use Option Explicit?

 - Tom


Quote:> Can someone tell me what the heck is wrong with the code below? I
keep
> getting an "Datasource name not found and no default driver
specified". I
> have tried every damn way I can think of to be able to use App.Path
to my
> database but I keep getting this error. If I go with the wizard
which set's
> a fixed path then everything works fine but I don't want a fixed
path.
> Thanks

> Dim db As ADODB.Connection
>     Dim rs As ADODB.Recordset
>     Set db = New ADODB.Recordset
>     db.Provider = "Microsoft.jet.OLEDB.4.0"
>     db.Open App.Path & "\Scheduling.mdb", "admin", ""
>         Connectstring = "Provider=" & _
>         "Microsoft.jet.OLEDB." & _
>         "4.0;data source=" & _
>         App.Path & "\Scheduling.mdb"


 
 
 

Need help with ADO connection

Post by Philip Pric » Tue, 01 Aug 2000 04:00:00


Yes

* Sent from Devdex.com http://www.devdex.com The Web Developers Index *
The world's largest index site for web developers.

 
 
 

1. Need help with ADO Connection of a distributable application

I have no problem with this VB project in our own network which has the
following connection code:
sConnectionString = _
    "Provider=Microsoft.Jet.OLEDB.3.51;" & _
    "Persist Security Info=False;" & _
    "Data Source=S:\do\Management System\abc.mdb"

But since we are going to distribute the application (.exe file) to many of
our parteners, and they are not supposed to have the same directory for Data
Source as ours, is there any other way to resolve such problem so that
anyone can use the same application in different environment? Thanks a lot.

John

2. VB/Access Question

3. Need help with connection string ADO

4. Generating Maps from SQL data?

5. ADO Connection Gets Dropped - Help Needed

6. Does borland have a news server?

7. Need help with ADO/ODBC connection

8. request for database bug 'war stories'

9. Access Database, ADO-ODBC, Connection string help needed ...

10. need help,question of connections of ADO

11. Need to read sql2k table thru ado, need connection statement

12. HELP!!! NEED HElp: problem with ado

13. Need advise on ADO and Connection object.