|
-
Nov 17th, 2000, 01:07 AM
#1
Thread Starter
New Member
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
-
Nov 17th, 2000, 03:27 AM
#2
Addicted Member
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!"
-
Nov 17th, 2000, 01:47 PM
#3
Thread Starter
New Member
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
-
Nov 17th, 2000, 02:21 PM
#4
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|