Unable to establish connection through Odbc driver

Hello!

I have a problem regarding Odbc driver. So, here's the thing: i'm using .net framework v1.1 and have a .mdb database that i would like to connect to. When i use oledb provider works fine, but when i would like to use dsn and odbc driver i just can't figure it out.
The code:
<%@ Page Language="VB" debug="true" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.Odbc" %>
<script runat="server">
Sub Page_Load()
' Code that populates datagrid
Dim strConnection as String
Dim strSQL as String
Dim objConnection as OdbcConnection
Dim objDataSet as New DataSet
Dim objDataAdapter as OdbcDataAdapter
strConnection = "Provider=Microsoft.Jet.Odbc;Data Source=c:\program files\common files\odbc\data sources\test.dsn"
strSQL = "SELECT FirstName, LastName FROM Employees"
objConnection = New OdbcConnection(strConnection)
objDataAdapter = New OdbcDataAdapter(strSQL, objConnection)
objDataAdapter.Fill(objDataSet, "Employ")
dgNameList1.DataSource = objDataSet.Tables("Employ")
dgNameList1.DataBind()
...
....
So here i've made a dsn that points to .mdb and from here i would like to connect. I guess the problem is with "Provider" section...but i'm a newbie with .net so i'll appreciate any help or hint with this. Thanks!
0
Lookie
10/20/2003 2:34:23 PM
asp.net.access-datasource 4679 articles. 0 followers. Follow

1 Replies
618 Views

Similar Articles

[PageSpeed] 25


.........prova=odbc datasource
.........stringa=select string
try this

Dim ocon As New ADODB.Connection() : ocon.Open(dsn=Prova;uid=;pwd=;)
Dim Rs2 As New ADODB.Recordset() : Rs2 = ocon.Execute(stringa)
Dim ds2 As New DataSet("recordset") : ds2.Tables.Clear()
Dim DA2 As New OleDb.OleDbDataAdapter() : DA2.Fill(ds2, Rs2, "tabella")
If ds2.Tables("tabella").Rows.Count <> 0 Then
end if

Bioing. Martin H.

0
martin
10/20/2003 3:20:37 PM
Reply:

Similar Artilces:

ODBC connect to Access database fails [Microsoft] [ODBC Driver Manager] Program Type out of Range
I was connecting and updating an Access97 Database OK. Office2000 was installed by our Help Desk and now I get the error SQLSTATE = S1003 [Microsoft] [ODBC Driver Manager] Program Type out of Range I tried creating an New ODBC entry with a newly created MSAccess database but got the same error. Any Help Appreciated I remember having this error also. What i did to solve it was the following -click the database painter -you get a list of all tables of your current db -press cancel button -change your connect in File/connect to the correct db. HTH John Which P...

[Sybase][ODBC Driver]Unable to connect to database server:unable to start database engine (#-80)
Hi ! I hope somebody could help me. Here is the problem in details : I have an SQL ANYWHERE 5.0 database on a server machine named "fr1dbsybase". I have an SQL CLIENT 5.0 on my machine. I configure an ODBC connection on my machine. I want to connect to the database with MS ACCESS via the ODBC connection. But I got the error message : [Sybase][ODBC Driver]Unable to connect to database server:unable to start database engine (#-80) -------- I tried something else. I uninstall the client on my machine and install the server. I start the sample database &qu...

SQLSTATE = 08001 [Sybase][ODBC Driver] Unable to connect to database server.unable to start database engine.
Hi, When running my PB application in PB it works fine, a splash screen and then the application. When running my application through Powerbuilder WDK the splash screen shows up and then a login box shows up which shouldn't. This box asks for a username and password and has the title "Connect to SQL Anywhere". I know it's a result of the SQLCA properties but I don't know how to fix the problem. Can any one help me out? The SQLCA code and ini file is below. PB code: startupfile = "pds.ini" /* Populate sqlca from current pds.ini settings */ sql...

Connecting to Access with ODBC 4 driver
Hi there, I am connecting a PB 6.51 build 1216 app to an Access 97 and Access 2000 database. This was developed on a machine that I think had the MS Access ODBC version 3.5 driver and an MS Access 97 mdb database file. I am now running the compiled app on machines that have ODBC 4 drivers installed. The version of file pbodb60.dll is 6.5.00.1216 and the MS Access ODBC driver being used is 4.00.4403.02. I am getting some peculiar problems when deleting records using in-line SQL and then retrieving a datawindow that is still showing the deleted records - if I debug it and put ...

ODBC Access/Driver under MS .net
Hi, we're having problems connecting to SQLAnywhere 6.0.4. under Microsoft ..net (Beta 2) development platform. Anybody having similar problems or recommendations. We currently can only retrieve numbers and char defined fields, but not timestamps or several fields defined different from number or char. Thanks, Klaus Although I haven't tried any .NET using Microsoft's OLEDB Provider (which you would have to use for version 6.04), here is a sample I whipped up for version 8, using the sample database provided. Don't know if this helps or not. <%@ Page Lan...

ERROR [HY000] [MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'IP Address of the server'(10048) ERROR [HY000] [MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'IP of the server' (10
Hi, I am randomly getting the following error message in my application. ERROR [HY000] [MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'IP Address of the server'(10048) ERROR [HY000] [MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'IP of the server' (10048) I am using .Net 2.0 with VS2005 having ODBC 3.51.14 Driver.  Can any body point out the core reasons of the above error message? Thanks. Nouman Khawaja. I do have the same problem, help me out. Thanks  If the going seems easy, You are going DownHill... When I was writing ...

ODBC error:[Sybase][ODBC Driver] Connection not open:not connected to SQL database
Aloha, Have you come across this error before? Is it a Sybase error or a Crystal Reports error? Any clues? Mahalo, Lydia Villanueva Management Information Systems Grand Wailea Resort, Hotel & Spa It looks like you are attempting to communicate over a connection that has not been established or has been severed. Have you got any additional information? -- Jim Egan [TeamPS] Dealer Solutions, Inc. Houston, TX See you at the Powersoft User Conference in August - http://www.sybase.com/events/psuc98 ...

ado.net returns client unable to establish connection
using the sybase samples provide with sybase ase 12.5.2 developer edition, and when I go to open the connection i get the error 'client unable to establish a conection', the only thing I think it could be is that the xp server and sysam services. Have got both odbc and oledb drivers working. However, sql advantage doesn't work. The sybase ado.net driver is v1.1.327.0. Anyone got any ideas of the problem. I'm running the windows version on xp pro with sp2 on a p42.8ghz machine with 756mb ram and over 8gb hdd free space. If ODBC and OLEDB are working then teh ADO.NET...

Direct Connect Anywhere and Client Access ODBC Driver to AS400
All, is there any way to use the Direct Connect Anywhere Gateway with Client Access ODBC Driver to connect to AS400 with using proxy-tables in ASE. After installing i can connect to AS400 in passthru mode. But i cannot create proxy tables. Command : sp_addobjectdef papf,"CA400...papf","table" go create existing table ......... go Error Message Remote Object "papf" not found Thank you Claus Rosenberger ARA Moden GmbH & Co. KG ...

Direct Connect Anywhere and Client Access ODBC Driver to AS400
All, is there any way to use the Direct Connect Anywhere Gateway with Client Access ODBC Driver to connect to AS400 with using proxy-tables in ASE. After installing i can connect to AS400 in passthru mode. But i cannot create proxy tables. Command : sp_addobjectdef papf,"CA400...papf","table" go create existing table ......... go Error Message Remote Object "papf" not found Thank you Claus Rosenberger ARA Moden GmbH & Co. KG try sp_addobjectdef papf,"CA400..<library>.papf","table" where <library>...

Possible to connect the SqlDatasource with MySQL Connector/NET or is a ODBC driver required?
 Hi, I am using the MySQL Connector/NET 5.2.5.0 right now to use all the membersip stuff with my MySQL 5.0 database and it works great. Now I want to test this example http://www.asp.net/learn/videos/video-07.aspx (databinding a gridview to a datasource and enable editing) with my new MySQL-Connection. But when I want to choose a connection for my SqlDataSource there is no connection listed even though I have a connection in my web.config which already works with the membership stuff. This is my connection string: 1 <connectionStrings>2 <add na...

Connection to Access query works in developer envir, but not on the web <OleDbException (0x80004005): ODBC--connection to 'ODBC' failed>
I am VERY frustrated with a seemingly simple problem.  I am creating a gridview in VWD (express or studio), then connecting to a query within an Access Database.  The results of the query display without problem in the developer envirornment, but simply will not display when copied out to the website.  The ODBC connection that the Access Database is using fails even on the local machine.  I have spent fruitless hours looking at all security settings in IIS and the effected folders.  I could re-write all the access queries in SQL and connect to the server direct...

"SQL Error: [Sybase][ODBC Driver]Unable to connect to database server: authentication violation"
we are using SQL Anywhere Server with Power Designer 6.1. It's not possible to create or modify the Database form Power builder without this message "SQL Error: [Sybase][ODBC Driver]Unable to connect to database server: authentication violation" we are connected to the database as dba over odbc and the server is running. Further more its possible to make reverse Engineering from Power Designer. Does anybody knows whats the solution for this problem The engine that comes with PowerDesigner is authenticated and you can't do much with it outside of PowerDesigner....

OleDb.Net vs. ODBC.Net Connection to Oracle
I want to connect to an Oracle database, and I understand that I can use either the OleDB.Net data provider or the ODBC.Net data provider for my connection. Does it matter which one I use? What are the advantages and disadvantages of each? Would appreciate any input. ODBC is slower than OleDb. because ODBC has to talk to OleDbProvider then OleDbProvider will talk to Oracle Db. Instead if you are able to use OleDb straight to DB then it will be faster. If you only have THOSE choices, I would take OleDb over ODBC any day. If you are using Framework 1.1, you have the choice of using th...

Web resources about - Unable to establish connection through Odbc driver - 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 ...

Sydney's beauty relies on its visual and physical connection to nature
Landowners, custodians and developers must collaborate to create a healthy environment, happy residents and a more productive city.

Adam Savage from 'MythBusters' has an incredible connection to the 'Star Wars' franchise
Adam Savage, co-host of the popular " MythBusters " television show, soured on the plot of "Interstellar." But when it comes to the newest films ...

Heavyset woman with facial hair arrested in connection to downto - CBS News 8 - San Diego, CA News Station ...
Police were on the lookout Thursday for a heavyset woman with facial hair who stabbed a man in the East Village.

10th person arrested in connection with Paris attacks
CNN 10th person arrested in connection with Paris attacks CNN (CNN) Belgian police have arrested a 10th person in connection with last month's ...

Should auld connections be forgot...
This environmental testing company has strict data-retention requirements and they go beyond the data, reports a pilot fish on the scene. "Per ...

'How To Get Away With Murder' Season 2 Spoilers: Annalise, Wes, Eve's Connection Teased
... Away With Murder" season 2 will reveal more information about Annalise Keating (Viola Davis), Eve (Famke Janssen) and Wes' (Alfred Enoch) connection. ...

Resources last updated: 1/5/2016 2:30:11 AM