473,508 Members | 2,274 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access 2000 Linked to SQL Server 2000, openRecordset error

I'm trying to access data in vba using the openrecordset command. The
data in on a SQL Server 2000 database, and I have linked tables to
that data. the Table I'm trying to access is one of these linked
tables, and my codes is as follows:

Set vRS = CurrentDb.OpenRecordset(tbl_DataCommentLog)

when this line is executed I get the error:

"Run-time error '3622':

You must use the dbSeeChanges option with OpenRecordset when
accessing a SQL Server table that has an Identity column. "

so I changed my code to:

Set vRS = CurrentDb.OpenRecordset(vSQL, , dbseeChanges)

When this is executed the following error is generated:

" Run-time error '13':

Type mismatch "

I noticed that it didn't seem to recognise the 'dbseechanges'
arguement as usual the case is correct for known expressions, yet the
's' was not captialised on the 'dbseeChanges' !!!!

Please help this is driving me potty...
Nov 12 '05 #1
5 17856
Try

Set vRS = CurrentDb.OpenRecordset(vSQL, dbOpenDynaset, dbseeChanges)

Assuming that vSQL is a valid SQL statement.

Terry

"Philippa" <ph*************@systemc.com> wrote in message
news:9c**************************@posting.google.c om...
I'm trying to access data in vba using the openrecordset command. The
data in on a SQL Server 2000 database, and I have linked tables to
that data. the Table I'm trying to access is one of these linked
tables, and my codes is as follows:

Set vRS = CurrentDb.OpenRecordset(tbl_DataCommentLog)

when this line is executed I get the error:

"Run-time error '3622':

You must use the dbSeeChanges option with OpenRecordset when
accessing a SQL Server table that has an Identity column. "

so I changed my code to:

Set vRS = CurrentDb.OpenRecordset(vSQL, , dbseeChanges)

When this is executed the following error is generated:

" Run-time error '13':

Type mismatch "

I noticed that it didn't seem to recognise the 'dbseechanges'
arguement as usual the case is correct for known expressions, yet the
's' was not captialised on the 'dbseeChanges' !!!!

Please help this is driving me potty...

Nov 12 '05 #2
Thanks for you responce, I tried what you suggested (yes vsql is a
valid SQL Statement shown below), and it still doesn't work, this time
I get the following error:

" Run-tiem error '3001':

Invalid Argument. "

vSQL = "SELECT * FROM tbl_DataCommentLog WHERE Comment_FileUID = '" &
pForm!Header_FileUID & "'"
pForm being a paramter passed into the sub using the ME in the forms
private sub event. Even when I change vSQL to be just a valid table
name e.g. "tbl_DataCommentLog" it returns the same error !

I have succesfull managed to use the openrecordset method but this was
when the table to a acces table not a linked one. I think the fact
the vb is not recognising the arguements 'dbOpenDynaset' and
'dbSeeChanges' ( I know this as usually the case of keywords is
corrected, and it wasn't for these words ), is relevant but I don't
understand why !!!!

My tables are linked via a SQL Server driver ODBC connection, is this
significant....?

Cheers Philippa

"Terry Kreft" <te*********@mps.co.uk> wrote in message news:<bn0ll6$9d0
$1@newsreaderg1.core.theplanet.net>...
Try

Set vRS = CurrentDb.OpenRecordset(vSQL, dbOpenDynaset, dbseeChanges)

Assuming that vSQL is a valid SQL statement.

Terry

"Philippa" <ph*************@systemc.com> wrote in message
news:9c**************************@posting.google.c om...
I'm trying to access data in vba using the openrecordset command. The
data in on a SQL Server 2000 database, and I have linked tables to
that data. the Table I'm trying to access is one of these linked
tables, and my codes is as follows:

Set vRS = CurrentDb.OpenRecordset(tbl_DataCommentLog)

when this line is executed I get the error:

"Run-time error '3622':

You must use the dbSeeChanges option with OpenRecordset when
accessing a SQL Server table that has an Identity column. "

so I changed my code to:

Set vRS = CurrentDb.OpenRecordset(vSQL, , dbseeChanges)

When this is executed the following error is generated:

" Run-time error '13':

Type mismatch "

I noticed that it didn't seem to recognise the 'dbseechanges'
arguement as usual the case is correct for known expressions, yet the
's' was not captialised on the 'dbseeChanges' !!!!

Please help this is driving me potty...

Nov 12 '05 #3
How is vRS declared?
Terry

"Philippa" <ph*************@systemc.com> wrote in message
news:9c*************************@posting.google.co m...
Thanks for you responce, I tried what you suggested (yes vsql is a
valid SQL Statement shown below), and it still doesn't work, this time
I get the following error:

" Run-tiem error '3001':

Invalid Argument. "

vSQL = "SELECT * FROM tbl_DataCommentLog WHERE Comment_FileUID = '" &
pForm!Header_FileUID & "'"
pForm being a paramter passed into the sub using the ME in the forms
private sub event. Even when I change vSQL to be just a valid table
name e.g. "tbl_DataCommentLog" it returns the same error !

I have succesfull managed to use the openrecordset method but this was
when the table to a acces table not a linked one. I think the fact
the vb is not recognising the arguements 'dbOpenDynaset' and
'dbSeeChanges' ( I know this as usually the case of keywords is
corrected, and it wasn't for these words ), is relevant but I don't
understand why !!!!

My tables are linked via a SQL Server driver ODBC connection, is this
significant....?

Cheers Philippa

"Terry Kreft" <te*********@mps.co.uk> wrote in message news:<bn0ll6$9d0
$1@newsreaderg1.core.theplanet.net>...
Try

Set vRS = CurrentDb.OpenRecordset(vSQL, dbOpenDynaset, dbseeChanges)

Assuming that vSQL is a valid SQL statement.

Terry

"Philippa" <ph*************@systemc.com> wrote in message
news:9c**************************@posting.google.c om...
I'm trying to access data in vba using the openrecordset command. The
data in on a SQL Server 2000 database, and I have linked tables to
that data. the Table I'm trying to access is one of these linked
tables, and my codes is as follows:

Set vRS = CurrentDb.OpenRecordset(tbl_DataCommentLog)

when this line is executed I get the error:

"Run-time error '3622':

You must use the dbSeeChanges option with OpenRecordset when
accessing a SQL Server table that has an Identity column. "

so I changed my code to:

Set vRS = CurrentDb.OpenRecordset(vSQL, , dbseeChanges)

When this is executed the following error is generated:

" Run-time error '13':

Type mismatch "

I noticed that it didn't seem to recognise the 'dbseechanges'
arguement as usual the case is correct for known expressions, yet the
's' was not captialised on the 'dbseeChanges' !!!!

Please help this is driving me potty...

Nov 12 '05 #4
Dim vRS As Recordset

"Terry Kreft" <te*********@mps.co.uk> wrote in message news:<bn**********@newsreaderg1.core.theplanet.net >...
How is vRS declared?
Terry

"Philippa" <ph*************@systemc.com> wrote in message
news:9c*************************@posting.google.co m...
Thanks for you responce, I tried what you suggested (yes vsql is a
valid SQL Statement shown below), and it still doesn't work, this time
I get the following error:

" Run-tiem error '3001':

Invalid Argument. "

vSQL = "SELECT * FROM tbl_DataCommentLog WHERE Comment_FileUID = '" &
pForm!Header_FileUID & "'"
pForm being a paramter passed into the sub using the ME in the forms
private sub event. Even when I change vSQL to be just a valid table
name e.g. "tbl_DataCommentLog" it returns the same error !

I have succesfull managed to use the openrecordset method but this was
when the table to a acces table not a linked one. I think the fact
the vb is not recognising the arguements 'dbOpenDynaset' and
'dbSeeChanges' ( I know this as usually the case of keywords is
corrected, and it wasn't for these words ), is relevant but I don't
understand why !!!!

My tables are linked via a SQL Server driver ODBC connection, is this
significant....?

Cheers Philippa

"Terry Kreft" <te*********@mps.co.uk> wrote in message news:<bn0ll6$9d0
$1@newsreaderg1.core.theplanet.net>...
Try

Set vRS = CurrentDb.OpenRecordset(vSQL, dbOpenDynaset, dbseeChanges)

Assuming that vSQL is a valid SQL statement.

Terry

"Philippa" <ph*************@systemc.com> wrote in message
news:9c**************************@posting.google.c om...
> I'm trying to access data in vba using the openrecordset command. The
> data in on a SQL Server 2000 database, and I have linked tables to
> that data. the Table I'm trying to access is one of these linked
> tables, and my codes is as follows:
>
> Set vRS = CurrentDb.OpenRecordset(tbl_DataCommentLog)
>
> when this line is executed I get the error:
>
> "Run-time error '3622':
>
> You must use the dbSeeChanges option with OpenRecordset when
> accessing a SQL Server table that has an Identity column. "
>
> so I changed my code to:
>
> Set vRS = CurrentDb.OpenRecordset(vSQL, , dbseeChanges)
>
> When this is executed the following error is generated:
>
> " Run-time error '13':
>
> Type mismatch "
>
> I noticed that it didn't seem to recognise the 'dbseechanges'
> arguement as usual the case is correct for known expressions, yet the
> 's' was not captialised on the 'dbseeChanges' !!!!
>
> Please help this is driving me potty...

Nov 12 '05 #5
Not to worry, while looking in my object browser I noticed that there
was no DAO library, I made a new database and imported all my tables
and stuff, and its all working fine now. Cheers for peoples input.

ph*************@systemc.com (Philippa) wrote in message news:<9c**************************@posting.google. com>...
I'm trying to access data in vba using the openrecordset command. The
data in on a SQL Server 2000 database, and I have linked tables to
that data. the Table I'm trying to access is one of these linked
tables, and my codes is as follows:

Set vRS = CurrentDb.OpenRecordset(tbl_DataCommentLog)

when this line is executed I get the error:

"Run-time error '3622':

You must use the dbSeeChanges option with OpenRecordset when
accessing a SQL Server table that has an Identity column. "

so I changed my code to:

Set vRS = CurrentDb.OpenRecordset(vSQL, , dbseeChanges)

When this is executed the following error is generated:

" Run-time error '13':

Type mismatch "

I noticed that it didn't seem to recognise the 'dbseechanges'
arguement as usual the case is correct for known expressions, yet the
's' was not captialised on the 'dbseeChanges' !!!!

Please help this is driving me potty...

Nov 12 '05 #6

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

Similar topics

2
11257
by: Leader | last post by:
HI, i got a problem while using StrConv function in sql server. My requirement is:- suppose in a name field i have "jhon smith" Now i want to run a sql which will give me the result like "Jhon...
1
9851
by: ErickR | last post by:
We are experiencing a problem with Sql Server 2000 linking to an Access 97 file. We have two machines that link to this .mdb file, and we recently upgraded one to newer hardware, SP3a, MDAC 2.8,...
14
12542
by: Sudhesh Nayak | last post by:
Hi, I have an Oracle (8.1) & a SQL Server 2000 database with Production data. There are situations when I need data from both the databases. My first choice was to link Oracle to SQL and run DTS...
1
3595
by: Paul Stanial | last post by:
How viable is it to use MS Access as a front end (via ODBC) to a SQL Server 2000 database? The users would access via the internet using a netgear vpn setup. Thanks, Paul S
2
1870
by: Brian Salentine | last post by:
Hi - We have two SQL 2000 Servers. We have the linked server setup and we can perform updates and inserts between the databases. But when we add a trigger and insert something into a table, the...
0
1830
by: Matthias Jürgens | last post by:
Ich habe eine Datenbank die vorher komplett in Access war. Jetzt habe ich die Tabellen von Access auf SQL-Server portiert und in die Access-Datenbank als Frontend verknüpft. Jetzt habe ich...
1
2010
by: Kamyk | last post by:
Hello all! I have such question to all of you. I have some tables linked from MS SQL Server 2000. Is time of processing query based on these linked tables from MS SQL Server 2000, faster or...
2
9416
by: Charles Wilt | last post by:
I have a IBM iSeries (aka AS-400) running v5r3 of OS/400 that I access via a linked server from SQL Server 2000. The following select works fine: select * from...
0
1479
by: eroshenko | last post by:
Can somebody point me to the right direction how to create a linked server to db2 on z/OS using ODBC drivers or OLEDB providers that are free. thanks
0
1131
by: dordali | last post by:
Have a question. I have a table e.g. "Table1" on DB1 that is going to be archived once a month to "ArchiveTable1" on DB2, both on the one server. Will have to change SPs that were accessing...
0
7229
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
7129
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...
1
7061
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
7502
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
5637
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,...
1
5057
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
4716
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...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.