how can i write a connection string using DSN

i've used OleDb to connect and manipulate an access DB using direct connections and it worked well.

now i need to make use of the advantages of using ODBC so that if i change the DB any time i only need to change the DSN setting on the machine but nothing needs to b changed in the code.
i've setup the dsn of the access DB on the machine but i cant get it to work..how am i supposed to write the connection string?
i've tried:
"Driver={Microsoft Access Driver (*.mdb)};DBQ=E:\\Inetpub\\wwwroot\\ghadeer\\Data\\data.mdb;Dsn=sms-access.57"
it worked but i dont want to write the path of my DB and that's why i changed to ODBC from the first beginnig.
i tried :
"Driver={Microsoft Access Driver (*.mdb)};Dsn=sms-access.57"
but it wont work.
What exactly should i do .am i right in using OdbcConnection instead of OleDbConnection
0
eiman_k_elmasry
1/8/2005 9:29:26 PM
asp.net.access-datasource 4679 articles. 0 followers. Follow

2 Replies
536 Views

Similar Articles

[PageSpeed] 28

Try this code below 

DSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("db.mdb") & ";"
Set OBJdbConnection = Server.CreateObject("ADODB.Connection")
OBJdbConnection.Open(DSN)
Hope this helps
If I have seen further than others, it is by standing upon the shoulders of giants.
Isaac Newton
0
Alan_247
1/16/2005 6:07:07 PM
You can find many connection string here: http://www.connectionstrings.com/.
Gunnar Peipman

-- General Protection Fault
-- Illegal Page Fault
-- Not My Fault
0
Qnnn
1/17/2005 9:21:41 AM
Reply:

Similar Artilces:

How can i write this line: string[] nicks = new string[ users.Count ];
How can i write this line: string[] nicks = new string[ users.Count ];  - using vb.net? when: users = new Hashtable();   and also what the diffrence between: users.count and users.keys.count? Dim objHashTable As New Hashtable() objHashTable.Add("FName", "Bino") objHashTable.Add("LName", "Bose") objHashTable.Add("PNumber", 9895612345) This way you can add items to a hashtable in VB.NetCheersBinowww.codepal.co.inPlease Mark as Answer if you find the post useful. Dim Users As New Hashtable() Dim str As String() = ...

how can i write a connecton string that uses DSN?
i've used OleDb to connect and manipulate an access DB using direct connections and it worked well. now i need to make use of the advantages of using ODBC so that if i change the DB any time i only need to change the DSN setting on the machine but nothing needs to b changed in the code. i've setup the dsn of the access DB on the machine but i cant get it to work..how am i supposed to write the connection string? i've tried: "Driver={Microsoft Access Driver (*.mdb)};DBQ=E:\\Inetpub\\wwwroot\\ghadeer\\Data\\data.mdb;Dsn=sms-access.57" it worked but i dont want to ...

Connect Remote server MS Access DB with .Net using DSN
 Hi,Connect Remote server MS Access DB with .Net using DSN .My code is: String ss = "Provider=MS Remote;Remote Server=http://serverName:1433; Remote Provider=Microsoft.Jet.OLEDB.4.0;DSN=Test;";                   OdbcConnection con = new OdbcConnection(ss);        con.Open();        Response.Write("Connected");when i try to access, i am getting the following error ERROR [IM002] [Microsoft][ODBC Driver Mana...

Why we use Web.Config File for connection string wether we can use class Library for get connection for whole web Application
 Why we use Web.Config File for connection string wether we can use class Library for get connection for whole web Application  please help me? Friend, Web.config has its own advantages. 1) Web.Config is used to store the important information like connections strings etc...so that it can be modified even after the code has been    deployed to the server without compiling the entire application again. 2) Since it is a XML file, there is no need of building the project of you are going to change the connection strings.   If you go for the class files,...

is ODBC DSN required in eVB? can't use OLE DB connection string parameters
I am using eVB on the Pocket PC to connect to an ASA 8.0 database using ADOCE. I'm running into a problem with the ADOCE Connection's ConnectionString parameter. Seems to work just fine if you have a DSN file containing ODBC parameters, such as the "ASA 8.0 Sample.dsn" file installed with the ASA samples. In fact all the ASA samples rely on these DSN files and when setting up the ADO connection just set ConnectionString="Data Source=<DSN file name>". What I'd like to do is specify all the connection parameters in the ConnectionString, like yo...

Using VS.Net Data Connection Tool to Connect to Access Dbase?
I am trying to use the Visual Studio.Net data connection tool to connect to an Access database on a network server, not on my client machine. I've tried everything I can think of but nothing works. Can anyone provide steps/instructions/example/link about how to do this. My Access dbase, named sample.mdb, is located on a server at http://IP/AccountFolder, so the complete location is http://IP/AccountFolder/sample.mdb It is not password protected, but access to the account folder requires a username and password. The connection tool seems to be oriented to connecting to MSDK on th...

how can i write this line using vb.net : container.dataitem ?.... in vb.net its not working
Dim container As GridView = CType(newLinkButton.NamingContainer, GridView) Dim dataValue As Object = DataBinder.Eval(container.dataitem, _ColName)   _ColName its just a string a name of the field in my database   This is Vb.Net code man what you want? You can convert any format from this link http://www.developerfusion.com/tools/convert/vb-to-csharp/  If this post is answer of your question then don't forgot to Click Mark As Answer...

can't connect to sql server database with same connection used in visual studio .net 2003
I have the following code that works fine in visual studio .net 2003 but not with VWD.  I have sql server 2000 developer edition installed locally and this connection works fine with visual studio.  With VWD it fails with the exception "System.Data.SqlClient.SqlException: Login failed for user 'DARRELL\ASPNET'".  It fails on the conn.Open line.   any ideas on what the issue is?Dim conn As SqlConnectionDim connstr As Stringconnstr = "Data Source=DARRELL;Initial Catalog=Event;Integrated Security=SSPI;"Dim daEvents As New SqlDataAdapter("select * from events", connstr...

Can connection pooling be used with Access?
Can connection pooling be used with Access and if so is the same way as SQL Hello Ieotore, Access database doesnt have Connection pooling but MSSQL has this properity byeASP.NET Hosting (HostingFest) I do not believe that is true. Connection pooling is a part of ADO.NET, and to disable it in a connection string for OleDb (the provider used for Access) you set Ole Db Services=-4, so presumably, it is enabled by default.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog...

How do you write a class that can be used as a datasource
I would like to write a class that can be assigned to the DataSource property of a Repeater and fill it with the DataBind() call. As far as I can see, I need to implement IListSource that returns an IList. I'm using declarations like this in the ItemTemplate: where "Comm" is the name of a column of data in the source. What confusees me is how "Comm" is bound to the values in an IList. I already know how to do this as a DataSet, but I would like to be able to bind my own custom data class as well. We are still using asp.net 1.x, so I can't use 2.0 information. ...

Connecting to Microsoft Access using DSN
Hi! I'm using visual webdeveloper to make my application. I'm also using a microsoft access database with DSN. In the webconfig: <add key="connectionstring" value="DSN=XPTO"/> Note that my access database needs a password, that I give in the configuration off the System DSN. The problem is that in the webdeveloper everithing works fine... but now I have to test the application on a server, so I try to run first the application on my PC using IIS... http://localhost/myapplication, but gives me this error:  "ExecuteReader requires an ...

Can not access Fourms using BM38 Proxy but can access from Public side
I am using Netscape 7.1 newsgroups and I subscribe to support-forums.novell.com I have a BM3.8 server in a NW65 SP2 server When I try and get messages from the fourm I get the message "Failed to connect to the server forms-novell.com. I drop the filters and I get the same message I bypass the proxy and I get the same message I connect the machine directly to the public side of the network and I get access What could the problem be In article <QkE2d.12907$oo4.10306@prv-forum2.provo.novell.com>, Pete watters wrote: > When I try and get messages from the...

app.config connection string not being read
I have a Web app that has a UI Website Project and a DB dataset/db project. I am running SQL Server 2005 Express on my localhost for development purposes. I have the connectionstring for the DB in the DB projects app.config. The site is running perfectly on my localhost, but when I deploy the site to the review server and change the app.config's connectionstring accordingly a connection to the DB cannot be established. I then tried changing all the db names, usernames, password to jibberish in my app.config file on my localhost and running AND THE SITE STILL RAN ON LOCALHOST. For so...

Can I use DSN less to connect database
Hi, Can I use DSN less to connect database, like connect to *.mdb? from LEO ...

Web resources about - how can i write a connection string using DSN - asp.net.access-datasource

Connection - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

iMedia Connection: Interactive Marketing News, Features, Podcasts and Video - iMediaConnection.com
High-quality data, if not used properly, can still lead marketers to make bad decisions. Consider these common ways that numbers are used to ...

HTTP persistent connection - Wikipedia, the free encyclopedia
... tacked on to an existing protocol. If the browser supports keep-alive, it adds an additional header to the request: Following this, the connection ...

CareerSonar Turns Facebook Friends Into Job Connections
Looking for a job ? Among your Facebook friends lies the potential for employment. CareerSonar , a new service, brings together a person’s connections ...

Kings Cross identities arrested in connection with murder
Two Kings Cross identities&nbsp;have been arrested in connection with the murder of a man at Sydney hotel.

Faith: Spirits lift in connection with home
We need to more adequately understand the spirituality of our unique place on earth.

FBI mulls connection between Super Bowl, CA fiber optic cable cuttings
... authorities, who have been baffled by more than a dozen attacks on San Francisco Bay Area data lines, are probing whether there is any connection ...

Report: Man arrested in connection with Ashley Olsen's murder
Italian media agency reports that a non-EU male has been arrested in the murder of the 35-year-old American

Toyota and Kymeta rely on satellites to power this Mirai's data connection
They're hoping to achieve gigabit wireless speeds within the next few years.

Star Wars Rebels Trailer Reveals Force Awakens Connection - Collider
The new extended trailer for the mid-season premiere of the Disney XD animated series Star Wars Rebels reveals a huge connection to The Force ...

Resources last updated: 1/23/2016 8:17:11 PM