Results 1 to 4 of 4

Thread: connection string for ado on a dsn

  1. #1

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    connection string for ado on a dsn

    hi all, i have tried for an hour now to build an ado connection to open access database thru a n ODBC DSN.

    I have created the dsn from the control panel, it's name is reports

    now it doesn;t connect although if i used the location of the file directly , it works fine.

    i need the right connectionstring for DSN source including a password.


    by the way , i have checked www.connectionstrings.com , but the only thing for dsn is for VB6 conections.


    PLz help in this issue

    THX in advance

    BST RGDS

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    DSN
    Code:
    oConn.Open "DSN=mySystemDSN;" & _ 
               "Uid=myUsername;" & _ 
               "Pwd=myPassword"
    File DSN
    Code:
    oConn.Open "FILEDSN=c:\somepath\mydb.dsn;" & _ 
               "Uid=myUsername;" & _
               "Pwd=myPassword"
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  3. #3

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040
    thx for your reply.


    please note:

    1 - i tried your connection string, but it raised an exception " provider is required to connect".

    2 - i am using an oledbconnection , is there a problem in that????



    thx in advance for your time

    BST RGDs

  4. #4
    Hyperactive Member
    Join Date
    Jun 2002
    Location
    Tulsa,Ok
    Posts
    262
    I am having a similar problem but I am trying to connect to an AS/400 through ODBC with .Net. I can connect using vb 6.0 but I need it to run as a service.

    The thing that jumps out to me for you is you stat you are using an ODBC connection but the oledb provider. Have you tried the odbc provider for .net? I would start there for your odbc connection.

    Jerel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width