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

Access 2000 & Linked SQL tables problem

I'm trying to gather a single record from a SQL table. The SQL tables
are linked into the Acc DB.

Here is my code I'm trying to do. I should note that this DB was
converted from Acc97
I've tried to add things like "dao" to the variable declarations.
Dim CurrentDataBase As DAO.Database
Set CurrentDataBase = CurrentDb

Dim qryPowder As DAO.Recordset
Set qryPowder = CurrentDataBase.OpenRecordset("SELECT DISTINCT Powder.*
FROM Powder where Grade = '" & txtGrade & "' And Batch = '" & txtBatch
& "'", dbOpenDynaset)
If qryPowder.EOF Then
MsgBox "Error reading Powder Table"
txtGrade.SetFocus
DoCmd.Hourglass False
Exit Sub
Else
qryPowder.MoveFirst
SinteredDensity = qryPowder.SinteredDensity
WeightLossFactor = qryPowder.WeightLossFactor
End If
The error occurs when the code gets to "sintereddensity" just after
movefirst. The message is "Compile Error: Method or DataMember not
found"

Thanks for any help

Jun 19 '06 #1
2 1360

Bruce Lawrence wrote:
I'm trying to gather a single record from a SQL table. The SQL tables
are linked into the Acc DB.

Here is my code I'm trying to do. I should note that this DB was
converted from Acc97
I've tried to add things like "dao" to the variable declarations.
Dim CurrentDataBase As DAO.Database
Set CurrentDataBase = CurrentDb

Dim qryPowder As DAO.Recordset
Set qryPowder = CurrentDataBase.OpenRecordset("SELECT DISTINCT Powder.*
FROM Powder where Grade = '" & txtGrade & "' And Batch = '" & txtBatch
& "'", dbOpenDynaset)
If qryPowder.EOF Then
MsgBox "Error reading Powder Table"
txtGrade.SetFocus
DoCmd.Hourglass False
Exit Sub
Else
qryPowder.MoveFirst
SinteredDensity = qryPowder.SinteredDensity
WeightLossFactor = qryPowder.WeightLossFactor
End If
The error occurs when the code gets to "sintereddensity" just after
movefirst. The message is "Compile Error: Method or DataMember not
found"

Thanks for any help


The code you wrote should work if you replace qryPowder.SinteredDensity
with qryPowder!SinteredDensity or qryPowder.Fields("SinteredDensity")
and qryPowder.WeightLossFactor with qryPowder!WeightLossFactor or
qryPowder.Fields("WeightLossFactor") provided that "SinteredDensity"
and "WeightLossFactor" are fields in your Powder table. And while your
code should work with these changes, it is generally customary to use
'rs' or 'rst' as a prefix for recordsets and 'qry' as a prefix for
queries, e.g. 'rstPowder' as opposed to 'qryPowder'. Hope this helps!

Bruce

Jun 19 '06 #2

de***************@gmail.com wrote:
Bruce Lawrence wrote:
I'm trying to gather a single record from a SQL table. The SQL tables
are linked into the Acc DB.

Here is my code I'm trying to do. I should note that this DB was
converted from Acc97
I've tried to add things like "dao" to the variable declarations.
Dim CurrentDataBase As DAO.Database
Set CurrentDataBase = CurrentDb

Dim qryPowder As DAO.Recordset
Set qryPowder = CurrentDataBase.OpenRecordset("SELECT DISTINCT Powder.*
FROM Powder where Grade = '" & txtGrade & "' And Batch = '" & txtBatch
& "'", dbOpenDynaset)
If qryPowder.EOF Then
MsgBox "Error reading Powder Table"
txtGrade.SetFocus
DoCmd.Hourglass False
Exit Sub
Else
qryPowder.MoveFirst
SinteredDensity = qryPowder.SinteredDensity
WeightLossFactor = qryPowder.WeightLossFactor
End If
The error occurs when the code gets to "sintereddensity" just after
movefirst. The message is "Compile Error: Method or DataMember not
found"

Thanks for any help


The code you wrote should work if you replace qryPowder.SinteredDensity
with qryPowder!SinteredDensity or qryPowder.Fields("SinteredDensity")
and qryPowder.WeightLossFactor with qryPowder!WeightLossFactor or
qryPowder.Fields("WeightLossFactor") provided that "SinteredDensity"
and "WeightLossFactor" are fields in your Powder table. And while your
code should work with these changes, it is generally customary to use
'rs' or 'rst' as a prefix for recordsets and 'qry' as a prefix for
queries, e.g. 'rstPowder' as opposed to 'qryPowder'. Hope this helps!

Bruce


Beautiful! I LOVE YOU

Jun 19 '06 #3

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

Similar topics

17
by: chicha | last post by:
Hey people, I have to convert MS Access 2000 database into mysql database, the whole thing being part of this project I'm doing for one of my faculty classes. My professor somehow presumed I...
6
by: Max | last post by:
Hi, I have SqlServer 2000 as back end and Access 2000 as front-end. All tables from Sqlserver are linked to Access 2000. I am having write conflict problem with one of my form which is bound to...
5
by: Praty77 | last post by:
Hello - we have been using access 97 for a multiple user trading system at a small bank. Typically around 10 users entered a total of hundred trades everyday. Some of the data was shared with a...
3
by: patcho | last post by:
Hello, I have a problem that I was hoping to get some assistance with. I have built a split database (back end with all the tables and a password to protect the information & a front end to link...
8
by: Alfonso Esteban Gonzalez Sencion | last post by:
I am trying to use Access as a front end for extracting information from an Oracle database. I started using linked tables but I am getting a very curious behaviour. When I consult the linked...
1
by: Paul | last post by:
Hello, I am converting an Access database on our network to a sql 2000 backend and keeping access as the front end. The access database has evolved and been a solution to collect data but now...
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 -...
2
by: egoldthwait | last post by:
I need to convert a 17mb access 2000 db to Oracle and house it in a Citrix farm. The issue: we have never converted an Access Db to Oracle but can probably use Oracle's Workbench to assist with...
1
by: gordon.dtr | last post by:
Hi, Has anyone had this problem ? I am using MySQL ODBC 3.51 Driver, with MS Access 2003 and MySQL 4.1.11 standard log. I created my tables in MS Access, then exported them via ODBC to an...
4
by: Vanessa | last post by:
Hi there I am an Access developer, and I have written applications for a 30 telephone call center, using the standard multiuser jet engine, it all works fine, but I want to move our systems onto...
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:
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...
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...
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,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.