Notices
Non Scooby Related Anything Non-Scooby related

Any Access2000 / Visual Basic programmers here ?

Thread Tools
 
Search this Thread
 
Old Aug 19, 2001 | 03:14 PM
  #1  
DazV's Avatar
DazV
Thread Starter
Scooby Regular
 
Joined: Jun 2000
Posts: 3,783
Likes: 0
Post

As Scoobynet is the oracle of all info...

Just wondering if anyone can tell me - in the earlier versions of access, eg. access97, the following was ok:

Dim dbs As Database
Dim rst As Recordset

Trouble is, using Access2000, I'm getting a compile error and its pointing to the above lines as the source of the error - anyone know if they replaced the 'database' object in Access2000, and if so, what is the replacement code ?

Full code snippet:
Set dbs = CurrentDb()
strSQL = "SELECT * FROM [Switchboard Items]"
strSQL = strSQL & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" & Me![SwitchboardID]
strSQL = strSQL & " ORDER BY [ItemNumber];"
Set rst = dbs.OpenRecordset(strSQL)
Reply
Old Aug 19, 2001 | 04:08 PM
  #2  
ChrisB's Avatar
ChrisB
Moderator
 
Joined: Dec 1998
Posts: 23,573
Likes: 0
From: Staffs
Thumbs up

Daz,

From a Visual Basic code edit window without the code running...

Click Tools > References

From the list of ticked references, do you have any called something like "Microsoft DAO xxxx Object Library".

If not, scroll down the list and you should have a choice of a few. On this PC (Win 2000 Pro + Office 2000 Pro), I have the following...

MS DAO 2.5/3.51 Compatability Library
MS DAO 3.51 Object Library
MS DAO 3.6 Object Library

Tick one, click OK and your code should work.

Actually, do any of the ticked references at the top of the list have MISSING against them? Even if you are not using a function or type from the library marked MISSING, Access will often refuse to compile or run code until the tick is removed from the module or it is installed.

HTH,

ChrisB.
Reply
Old Aug 19, 2001 | 04:21 PM
  #3  
KF's Avatar
KF
Scooby Regular
 
Joined: Feb 2000
Posts: 405
Likes: 0
Post

Shot in the dark from someone with no Access 2000 and little VB...
Could it be a DAO 3.6 problem?
Have you set a permanent reference to the DAO 3.6 Object library?
The code looks to be OK.
Good luck!
KF.
Reply
Old Aug 19, 2001 | 04:25 PM
  #4  
KF's Avatar
KF
Scooby Regular
 
Joined: Feb 2000
Posts: 405
Likes: 0
Post

Haha...
Was composing whilst ChrisB was posting... Looks like DAO could be the culprit.
Reply
Old Aug 19, 2001 | 05:15 PM
  #5  
DazV's Avatar
DazV
Thread Starter
Scooby Regular
 
Joined: Jun 2000
Posts: 3,783
Likes: 0
Post

Thanks all.

Looks like the code was written for an earlier version of Access, and hasn't been converted properly to run on Access2000.

I'll try that tools > options thing.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Frizzle-Dee
Essex Subaru Owners Club
13
Dec 1, 2015 09:37 AM
crazyspeedfreakz
Wanted
17
Oct 5, 2015 07:19 PM
Davalar
General Technical
19
Sep 30, 2015 08:54 PM
Nick_Cat
Computer & Technology Related
2
Sep 26, 2015 08:00 AM




All times are GMT +1. The time now is 10:12 AM.