*
The moose likes Servlets and the fly likes Hot to use File DSN make connection? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Hot to use File DSN make connection?" Watch "Hot to use File DSN make connection?" New topic
Author

Hot to use File DSN make connection?

Eric Wang
Greenhorn

Joined: Dec 21, 2000
Posts: 22
Hi:
I hava a file DSN link to my Access database is named as web.dsn
______________
[ODBC]
DRIVER=Microsoft Access Driver (*.mdb)
UID=admin
UserCommitSync=Yes
Threads=3
SafeTransactions=0
PageTimeout=5
MaxScanRows=8
MaxBufferSize=2048
FIL=MS Access
DriverId=25
DefaultDir=D:\
DBQ=D:\webfriends.mdb
_______________________
1. So how should I use web.dsn, will it work using this way?
2. And if it works, where should I put the web.dsn file?
3. I have try this code, but it won't work, why?
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc dbc:web.dsn", "", "");
Thank you.
Eric
Ravee Bhat
Ranch Hand

Joined: Nov 26, 1999
Posts: 72

Hey
Are you sure you created this DSN using the win ODBC data sources configuration tool?
regards
ravee.
Eric Wang
Greenhorn

Joined: Dec 21, 2000
Posts: 22
Hi Ravee:
Thank you the reply first. Yes, I use the win ODBC to create my web.dsn file.
Does it anywrong in the file.
cheers
Eric
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Eric,
Which platform are you using? Win NT or Win 98? In win 98,
StartMenu....>Settings..>ControlPanel...>click on ODBC Data Source(ICON)....>UserDSN(Tab)...>Add...>Select MicroSoft Access Driver(*.mdb)....>Click on Finish....>Type Data Source Name Eg. AMSDatabase....> click on Select...>Browse to your .mdb file ...>Click on OK
Did you do this procedure ?
regds
maha anna
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Hot to use File DSN make connection?
 
Similar Threads
jdbc:odbc with DSN less connection for MS Access
how dsn can be used on deployment server
JDBC without DSN
Connecting to MS Access 2000
creating a DSN