Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

change File DSN using Vb program

Posted on 2004-08-04
11
420 Views
Last Modified: 2013-12-25
How can i change a file DSN using a vb application???
0
Comment
Question by:pg_india
  • 4
  • 3
  • 2
11 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 11714293
You simply need to re-create (overwrite) it. See http://support.microsoft.com/default.aspx?scid=kb;en-us;184608&Product=vb6
0
 
LVL 3

Author Comment

by:pg_india
ID: 11714798
that article discuss about the system dsn. is the process same for file dsn???
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 11715085
I never used file DSN (in fact I never use DSNs otherwise being forced to!)

Try to create a system DSN and use from your application to see which one (system or file) will be used.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 3

Author Comment

by:pg_india
ID: 11715219
actually i am using crystal report and i thk crystal erport works with DSn only and not without that!! Please correct me if i am wrong.

Also how can i retrieve the values from an existing file DSN? because before changing i shoudl know whether a change is required or not..
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 100 total points
ID: 11715538
>>i thk crystal erport works with DSn only and not without that

Which version? I use CR7 (with VB6) with .ttx (I send ADO recordsets) and also CR.Net (with VB.Net 2003) with strongly typed-datasets. All this without having CR to connect itself to a database. All the data is provided by my applications.

>> because before changing i shoudl know whether a change is required or not..

It is so quick that you replace it without checking. It would take longer to check!
0
 
LVL 3

Expert Comment

by:JamesPMCD
ID: 11728910
IF your using an ODBC connection with your DNS name, you can just change a value in the registry on the machine to achive your results. query the registry for the DNS you require and if it is not correct, change it to the appropriate value. I use this to change from an MS Access to an SQL server connection and use the same report with both version in a CR viewer in a VB project.
0
 
LVL 3

Author Comment

by:pg_india
ID: 11733525
actually i am using file dsn...is that stored in registry??? What i have heard is that file dsn can be copied directly from one system to another and they are machine independent. in that case no value should be stored in dsn!
also if i change any detail in file dsn using a notepad do i need to update anything in registry.
0
 
LVL 3

Expert Comment

by:JamesPMCD
ID: 11734527
Yes it is. You can create seperate registry key and store them as .reg file. as you need them you import them to the registry and have your report use the same key to different datasources.
0
 
LVL 3

Author Comment

by:pg_india
ID: 11734989
James i didn't understand you,
my question is:

can i use a file dsn created on a system A on another system B without anything to do with Registry?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adding to a VBA? 6 78
VB6 - Compare and highlight cell not the same 3 53
Add a task in Outlook from access 11 42
adding "ungroup sheets" to existing vbs code 5 31
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question