473,396 Members | 2,057 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,396 software developers and data experts.

database linking

I am trying to link to tables in a database. I have used the following code,
but I get the following error
Run-time error '-2147467259 (80004005)':

Method 'RecordSet' of Object '_Form_Sales Order Log' failed.

What I am trying to do is while in the form Sales Order Log, but able to
access information in the customerdbnew table. Thanks for any help.

Private Sub ShipmentRequest_Click()

Set Me.Recordset = rstNwind
Dim cnnNwind As New ADODB.Connection
Dim rstNwind As New ADODB.Recordset

With cnnNwind
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Open "\\Backup\hosted files\CustomerDatabase\customerdbnew.mdb",
"admin"
End With

With rstNwind
Set .ActiveConnection = cnnNwind
.CursorType = adOpenKeyset
.CursorLocation = adUseClient
.LockType = adLockOptimistic

End With
Set Me.Recordset = rstNwind
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200508/1
Nov 13 '05 #1
1 1408
That Guy via AccessMonster.com wrote:
I am trying to link to tables in a database. I have used the following code,
but I get the following error
Run-time error '-2147467259 (80004005)':

Method 'RecordSet' of Object '_Form_Sales Order Log' failed.

What I am trying to do is while in the form Sales Order Log, but able to
access information in the customerdbnew table. Thanks for any help.

Private Sub ShipmentRequest_Click()

Set Me.Recordset = rstNwind
Dim cnnNwind As New ADODB.Connection
Dim rstNwind As New ADODB.Recordset


Remove the Set Me.Recordset = rstNwind in the line before
Dim cnnNwind.... rstNwind isn't defined until the line after Dim
cnnNwind; and, you have the Set command in the correct position - at the
bottom of the Sub routine, anyway.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Nov 13 '05 #2

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

Similar topics

1
by: Shyam Singh | last post by:
I have two database Student and Course both have a relation on it. Student ID is the primary key for Student Table and Course ID is the primary key for course table. As per my logic, one student...
5
by: Brian | last post by:
I need to import data from 720 csv files into an Access database so I can do some editing prior to loading into a SQL Server. These files came from data output from a mainframe on a monthly basis....
0
by: gasturbtec | last post by:
please help im new at access programming and i just got this project dropped in my lap because the old programmer quit. i've been doing ok so far but now i need to add code to an existing database...
1
by: deiopajw | last post by:
I have a Back end database on a network drive. The copies of the front end are located on individual pc's (in their C drive). The problem arises when a laptop user naturally hooks up to the...
1
by: gopinathanr | last post by:
I am having a VB 6.0 program where I am using an MS Access database. This database has some tables that have been created by linking to MySql database using the MySQL ODBC 3.51 Driver. When I try...
1
by: gopinathanr | last post by:
I am having a VB 6.0 program where I am using an MS Access database. This database has some tables that have been created by linking to MySql database using the MySQL ODBC 3.51 Driver. When I try...
8
by: rdemyan via AccessMonster.com | last post by:
I've converted my application from A2K format to A2003 format. I tried to follow Allen Browne's protocol in getting my app into A2003 (although I was unable to find informtion on the conversion...
1
by: GregZ | last post by:
I have an Access 97 database that I have uploaded to the internet. I have created a DSN for it with the hosting company and can now access it using .asp code. Everything here works fine. But, I...
7
by: coolsti | last post by:
I have the task to set up an application at work,using MS Access as a front end to a MySQL database. This will be done using an appropriate ODBC driver, and linking the MySQL database to Access. ...
25
by: zmickle | last post by:
Excuse my noobness. I am managing an access database that is shared by 4 users. Management does not want to use any technologies outside of access for this application (no SQL Server, etc). I...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
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,...

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.