Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hot to use File DSN make connection?

 
Eric Wang
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 72
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey
Are you sure you created this DSN using the win ODBC data sources configuration tool?
regards
ravee.
 
Eric Wang
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic