473,395 Members | 1,471 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,395 software developers and data experts.

Linked table - ODBC connection ... failed

An error "ODBC connection to [name of SQL Server] failed"
is raised when I am trying to get data from a table in
Microsoft Access (97, or 2000) which is actually a linked
table to another table in SQL Server 7 . The exception is
raised from a Web .Net app while exactly the same code
works fine in Windows .Net app. That makes me thinking the
issue somehow is related to security context. Anyway I do
not know how to solve the problem, and any help is
appreciated.

Windows 2000, XP; IIS 5.0; .Net Framework 1.1.; Visual
Studio .Net 7.1.3088; SQL Server 7; OleDb connection to
Jet 4.0;

Below there are the steps to reproduce the problem.

Step 1.
Run AdministrativeTools->DataSources. Create a data source
(DSN) to the database "pubs" of SQL Server.
Let's call it "LinkedPubs".

Step 2.
Create a database in MSAccess 97. Let's call
it "db1.mdb". Go to File->Get External Data->Linked
Tables.Select "ODBC databases". In the list of data
sources select newly created DSN "LinkedPubs". In the next
list of "Linked Tables" select table "dbo.authors". Close
MSAccess.

Step 3.
Start Visual Studio .Net. Create a new ASP.Net
application. Drag OleDBAdapter to the page, and start
configuring it. Select database "db1.mdb" as the data
connection. Create a query, say "SELECT au_fname FROM
dbo_authors". Finish the wizard.
Put a button on the page and place the following code to
handle button click:

==================
Private Sub btnGetAuthors_Click(ByVal sender As Object,
ByVal e As System.EventArgs) Handles btnGetAuthors.Click

Dim ds As New DataSet
Dim ID As String
Dim err As String

Try
Me.OleDbConnection1.Open()
Me.OleDbDataAdapter1.Fill(ds)
ID = ds.Tables("dbo_authors").Rows(0).Item
(0).ToString()
btnGetAuthors.Text = ID
Catch ex As System.Data.OleDb.OleDbException
err = ex.Message
btnGetAuthors.Text = err
End Try

Me.OleDbConnection1.Close()
End Sub
=======

That's it.

When I run the application, click the button, the line
Me.OleDbDataAdapter1.Fill(ds) raises an exception "ODBC
connection to [name of SQL Server] failed".

I created a Windows .Net application using the same DSN,
the same adapter, and it works fine. For Web .Net app
described above I can use "Preview Data" of the adapter,
and I can see the list of authors.
Nov 17 '05 #1
0 3683

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: David Gray | last post by:
Hello all, Having problems connecting to an Oracle 9i database from within SQL/Server 2000 using the Security/Linked Servers feature. Server1 (SQL/Server) ----------- Windows Server 2003,...
3
by: James Bird | last post by:
Hello In order to perform a hetrogeneous join (I think that's what they're called) between MySQL and another database, I've created an Access database containing linked tables from each...
6
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
3
by: Oren | last post by:
Hi, Is there a way to hide the connection information of linked SQL Server tables from users? It's easy to open a system table and find the connection info, and if the username and password are...
0
by: crypto_solid via AccessMonster.com | last post by:
I have been using a SQL database with a VB5 frontend for about 5 years. Works well. Unfortunately I don't have access to the source code. I was tasked with implementing a "job entry" application...
7
by: smd | last post by:
Hello and thanks for taking the time to read this. I've looked all over the web and newsgroups and can't find a solution to my problem. I've posted this question to the Access 2000 group as well -...
0
by: Igor | last post by:
An error "ODBC connection to failed" is raised when I am trying to get data from a table in Microsoft Access (97, or 2000) which is actually a linked table to another table in SQL Server 7 . The...
0
by: EJO | last post by:
Thanks everyone! My workgroup is in a mixed enviroment for using an Access 2k mde as the front end of a sql server 2000 which is running on the same machine that some of my users access using...
1
by: technocraze | last post by:
Hi guys, I am having trouble resolving this error. Below mentioned is my code and implmentation. MS Acess is my front end and sql server is my backend. What i want to achieve is to be...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.