PC Review


Reply
Thread Tools Rate Thread

2000 vs. 2002 VB Problem

 
 
=?Utf-8?B?SmVmZiBH?=
Guest
Posts: n/a
 
      22nd May 2006
Now that I am running my access on 2002 instead of 2000 I am having a problem
getting some VB script to run. My programmer is out of the country for two
months so it's up to me. Here is the script that isn't running properly
below...


Sub CreateUserStatsRecords()
' assumes date is in fparam(4)

On Error Resume Next
Dim db As Database
Set db = DBEngine.Workspaces(0)(0)
Dim cs As Recordset
Dim sql As String
Dim TheDate As String
Dim date1 As String
date1 = Format$(fparam(4), "short date")
'thedate = "#" & date1 & "#"
TheDate = "#" & Left$(date1, Len(date1) - 2) & "20" & Right$(date1, 2) &
"#"
Dim crit As String

Dim us As Recordset
sql = "select * from [User Stats] where [Day] = " & TheDate
Set us = db.OpenRecordset(sql, DB_OPEN_DYNASET)

Set cs = db.OpenRecordset("Call Summary query 3", DB_OPEN_SNAPSHOT)
Do Until cs.EOF
DoEvents
crit = "[User Ptr] = " & Str$(cs![User Ptr])
us.FindFirst crit

If us.NoMatch Then
us.AddNew
us![User Ptr] = cs![User Ptr]
us![Day] = fparam(4)
us![Paid Hours] = cs![Default Hours]
us.Update
End If

cs.MoveNext
If Err Then Exit Do
Loop

cs.Close
us.Close


End Sub


If I run it on a Access 2000 machine, it runs properly. But if I run it on
Access 2002, I don't get anything.

I don't know much about this, so any help I can get would be greatly
appreciated. Thanks.
 
Reply With Quote
 
 
 
Reply

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
2000 vs. 2002 VB Problem =?Utf-8?B?SmVmZiBH?= Microsoft Access 2 22nd May 2006 08:12 PM
2000/2002 connection problem FM Microsoft Frontpage 8 26th Feb 2004 05:15 AM
2000 to 2002 powerpoint problem CYberg Microsoft Powerpoint 4 5th Dec 2003 04:00 AM
convsersion from 2000 to 2002 problem Dave in Omaha Microsoft Access Reports 0 17th Oct 2003 02:27 AM
2002-2000 (or VB6.3-VB6.0) problem John Meers Microsoft Excel Discussion 1 26th Aug 2003 10:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:29 PM.