Results 1 to 4 of 4

Thread: Setting up DSN or PDW HELP

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    2
    I am haveing a problem with my Crystal report page that requires a DSN. When I use the Package and Deployment wizard it does not create my DSN for me. How do I set one up in code so I don't have to create one on every machine?
    Thanks
    Thom

  2. #2
    Addicted Member Skeen's Avatar
    Join Date
    Jul 2000
    Location
    Abingdon, Oxon
    Posts
    138

    Mmm Bop

    Yeah,

    DSN is the data source name and so its what you've called your database. Use it in a connection string like this:

    Set cnOBJECT = CreateObject ( "ADODB.Connection" )
    cnOBJECT.ConnectionString = " Provider=MSDAORA.1; " _
    & " DSN=Databasename; " _
    & " UID=Username; " _
    & " PWD=Password;"
    cnOBJECT.open

    cnOBJECT is the connection object. You assign the connection string to this with infomation shown above,
    Provider - specific to the type of database you are using,
    MSDAORA.1 is for oracle databases, but a general one that seems to work on most is MSDASQL.
    DSN - Name of database and then the user/password you've set up as administrative level on your database.
    Then open the connection.
    Use this at the beginnig of all your scripts, oh yeah at the end of the script its good practice to close down the connection:

    cnOBJECT.close

    Hope this helps

    Skeen

    "It wasn't the booze that made me snooze, It was the Gin that did me in!"

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    2

    I want to acutually create a ODBC connection

    Crystal reports is using a dao thus I want to create a ODBC connection with the dsn name as "Progressive". I want to this when the application starts so when I install this on another machine it will create the connection.
    Thanks
    Thom Morrow

  4. #4
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Check out this from MSDN.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

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