473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

create data source name (DSN) from command line

I need to create DSN from command line or command prompt for the deployment of my application.

Any help would be appreciated.

Thank you all in advance.
Mar 29 '08 #1
4 2103
balabaster
797 Expert 512MB
I need to create DSN from command line or command prompt for the deployment of my application.

Any help would be appreciated.

Thank you all in advance.
Could you not specify the connectionstring in your app.config instead of using a preformed DSN? It seems that this is a more convenient way of managing it. You would then specify connection settings in your application's setup?

If not, then it can be done programmatically - I don't think there's a command line tool for creating a DSN, however, you could write one in .NET using the technique found at:

http://support.microsoft.com/kb/q184608/

The code in this document is for VB, but it could easily be adapted to write a .NET console application which could in turn be used to create DSNs from the command line.
Mar 29 '08 #2
Thank you.
The actual problem is, I am connecting to a dsn through crystal report for the creation of my reports. I am thus worried about how the deployment is going to be without manually creating a dsn in the deployment environment.
Is there away to automate that process?
Personally I don't like the idea of connecting to a dsn to design my reports but tried connecting to the database directly (access database) but unsuccessful. I would be glad if you can help me complete this form:
Database Name: .....................
Database Type:....Access
User ID:....Admin
Password: ...............
Jet System Database: .........
Jet Database Password: ................


Could you not specify the connectionstring in your app.config instead of using a preformed DSN? It seems that this is a more convenient way of managing it. You would then specify connection settings in your application's setup?

If not, then it can be done programmatically - I don't think there's a command line tool for creating a DSN, however, you could write one in .NET using the technique found at:

http://support.microsoft.com/kb/q184608/

The code in this document is for VB, but it could easily be adapted to write a .NET console application which could in turn be used to create DSNs from the command line.
Mar 31 '08 #3
Thank you all.
I finally was enable to connect to my access database through crystal report.
The database name: is the path to the database file
User ID: not neccessary
Password: not neccessary
Jet System database: C:\Documents and Settings\Administrator\Application Data\Microsoft\Access\System.mdw
Jet Database password: password of access file

I am now working on trying to display the crystal report in my application (connecting to the tables involved at run time).
Any help would be welcomed.

Thank you.
The actual problem is, I am connecting to a dsn through crystal report for the creation of my reports. I am thus worried about how the deployment is going to be without manually creating a dsn in the deployment environment.
Is there away to automate that process?
Personally I don't like the idea of connecting to a dsn to design my reports but tried connecting to the database directly (access database) but unsuccessful. I would be glad if you can help me complete this form:
Database Name: .....................
Database Type:....Access
User ID:....Admin
Password: ...............
Jet System Database: .........
Jet Database Password: ................
Apr 2 '08 #4
The new problem is when I run the report, a get a form asking me to complete the form below:

ServerName: C:\\test.mdb
Database:
Login ID: Admin
Password:

I have entered the database password a number of times but failed to connect the table involved to make the report visible

Thank you all.
I finally was enable to connect to my access database through crystal report.
The database name: is the path to the database file
User ID: not neccessary
Password: not neccessary
Jet System database: C:\Documents and Settings\Administrator\Application Data\Microsoft\Access\System.mdw
Jet Database password: password of access file

I am now working on trying to display the crystal report in my application (connecting to the tables involved at run time).
Any help would be welcomed.
Apr 3 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: anon | last post by:
I have been used to using DAO in the past, and then converted to ADO. Now I am having to use VB.Net(2000) and ADO.NET and am experiencing difficulties with the creation and population of an mdb....
3
by: dek | last post by:
please review my asp code: <% Dim adoCon ''hold database connection object Dim rsAddRecord ''hold recordset for new record to be added Dim strSQL ''hold the SQL query to query the...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
8
by: DerekS | last post by:
Hi, I've been pulling my hair out trying to write a simple method to programatically create a system DSN with all parameters on a remote machine. I have ensured I have the correct permissions on...
0
by: Nick Poulis | last post by:
Hi to all I face the following problem, the following code (very simple) is contained in a referenced class method Dim cn As New OdbcConnection("DSN=BOC;UID=Admin;PWD=;") cn.Open()
2
by: Robert Smith jr. | last post by:
Hello, Please pardon my newbie question ... I am building an ASP.NET page that displays a recordset with a Delete statement enabled (this all works fine). I want to Insert the current row...
2
by: Dale Sampson | last post by:
My app uses an ODBC connection for a .mdb file. I want the app to create the source if it does not already exist (I copy a blank .mdb file to the users data store if it doesn't exist). I see how...
27
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.