Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 22nd, 2005, 10:36 AM
Fowler_ko Fowler_ko is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: Cumbria, UK
Posts: 277 Fowler_ko User rank is Second Lieutenant (5000 - 10000 Reputation Level)Fowler_ko User rank is Second Lieutenant (5000 - 10000 Reputation Level)Fowler_ko User rank is Second Lieutenant (5000 - 10000 Reputation Level)Fowler_ko User rank is Second Lieutenant (5000 - 10000 Reputation Level)Fowler_ko User rank is Second Lieutenant (5000 - 10000 Reputation Level)Fowler_ko User rank is Second Lieutenant (5000 - 10000 Reputation Level)Fowler_ko User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 5 Days 10 h 24 m 33 sec
Reputation Power: 84
Link Access 2000 to SQL Server 2000

I have a table on an SQL Server, have setup a DSN pointing to the SQL Server and then a link to the table in an Access 2000 database.

When using the following code keep getting the error message below:

Run-time error '3622'

You must use the dbSeeChanges option with OpenRecordset when
accessing a SQL Server table that has an IDENTITY Column.


Code:
 
	Dim DB As Database
	Dim Rst As Recordset
	Dim SQL As String
 
	SQL = "SELECT * FROM dbo_tblStaffTimeSheetAlloc;"
 
	Set DB = CurrentDb
 
	Set Rst = DB.OpenRecordset(SQL, , dbSeeChanges) 


Have had a hunt in MSDN but can't seem to find anything that will work! Any pointers much appreciated...

Reply With Quote
  #2  
Old March 31st, 2005, 07:03 PM
GEM1204 GEM1204 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Texas
Posts: 169 GEM1204 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 9 h 36 m 57 sec
Reputation Power: 5
Quote:
Originally Posted by Fowler_ko
I have a table on an SQL Server, have setup a DSN pointing to the SQL Server and then a link to the table in an Access 2000 database.

When using the following code keep getting the error message below:

Run-time error '3622'

You must use the dbSeeChanges option with OpenRecordset when
accessing a SQL Server table that has an IDENTITY Column.


Code:
 
	Dim DB As Database
	Dim Rst As Recordset
	Dim SQL As String
 
	SQL = "SELECT * FROM dbo_tblStaffTimeSheetAlloc;"
 
	Set DB = CurrentDb
 
	Set Rst = DB.OpenRecordset(SQL, , dbSeeChanges) 


Have had a hunt in MSDN but can't seem to find anything that will work! Any pointers much appreciated...


I think you need to use ado

Reply With Quote
  #3  
Old March 31st, 2005, 07:20 PM
GEM1204 GEM1204 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Texas
Posts: 169 GEM1204 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 9 h 36 m 57 sec
Reputation Power: 5
Sorry I didn’t give you a more complete answer in my last post



Try using ADO instead of DOA. I am also upsizing a access database to sql server and I’m having to convert all my code to ado. ADO is confusing at first but I’m getting used to it.


Dim sql As String
Dim rst As ADODB.Recordset

Dim Cnn As ADODB.Connection

Set rst = New ADODB.Recordset

sql = "SELECT * FROM dbo_tblStaffTimeSheetAlloc"

Set Cnn = CurrentProject.Connection

rst.Open sql, Cnn, adOpenKeyset, adLockOptimistic, dbSeeChanges



Since your linking tables you will have to supply your own connection string. I you were using an Access project you could use currentproject.connection


Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Link Access 2000 to SQL Server 2000


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT