473,732 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 AdministrativeT ools->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.author s". 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_C lick(ByVal sender As Object,
ByVal e As System.EventArg s) Handles btnGetAuthors.C lick

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

Try
Me.OleDbConnect ion1.Open()
Me.OleDbDataAda pter1.Fill(ds)
ID = ds.Tables("dbo_ authors").Rows( 0).Item
(0).ToString()
btnGetAuthors.T ext = ID
Catch ex As System.Data.Ole Db.OleDbExcepti on
err = ex.Message
btnGetAuthors.T ext = err
End Try

Me.OleDbConnect ion1.Close()
End Sub
=======

That's it.

When I run the application, click the button, the line
Me.OleDbDataAda pter1.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 3736

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

Similar topics

3
24284
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, Standard edition MS SQL/Server 2000 Oracle 9i Client kit (OLEDB & ODBC) & Enterprise management tools
3
2565
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 datasource. I create the linked tables without any problems, clicking on "save password" before selecting the desired tables. I can then access both tables fine from within the Access GUI.
6
6774
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 the SQL Profile to watch the T-SQL-Command which Access ( who creates the commands?) creates and noticed:
3
7136
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 saved with this info, anyone could potentially access this information. Much thanks, Oren
0
6889
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 that will allow a restricted list of users to enter jobs in the database. We do not want these users to be able to access all the data. I created an application in Access 2002 that performs this function seemingly quite well. However we now...
7
3424
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 - sorry for cross posting. Back ground: User at remote site has Access 2000 running on XP (don't know SP of either). Linked tables are DB2 v8 running on AIX. All of the linked tables are in the same database and schema.
0
513
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 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...
0
1462
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 Win2003 server terminal services. 1. users on the terminal server, co-located with the sql server, have no problems 2. users on their local machine (Win XP), get an error message:
1
4561
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 able to insert StudentId in the table matching the values chosen in the combo boxes and listboxes. This sound more like searching the table to insert StudentId matching the criterias. I have set the necessary configuration for ODBC connection (File...
0
8944
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8772
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9303
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9177
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8184
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6732
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3258
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2714
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2176
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.