473,545 Members | 2,679 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Converting database from Access97 to Access 2000-2003 with VBScripts

LMHelper
12 New Member
I am in the process of switching an Access Database that was originally designed in Access 97 and they need it to switch over to Access 2000-2003 Database Version. We have run into errors when moving it over (converting). The error I am stuck on now is Error 3251 which then brings me into a code window that states the following is not working and needs to be debugged:
rst2.FindFirst "[usedfpnumber] = " & varFPNum 'dcr 87 5 lines
I checked the table in use where this information is coming from and it has the correct information in it. The tableinUse table from the 97 version has the same information and set up as the new database copy in 2000-2003. Not sure why I'm getting this error and what to change in it.

Can someone assist me in some way as to what to look for?
Mar 27 '07 #1
12 2338
Denburt
1,356 Recognized Expert Top Contributor
What type of recordset did you open? Show us the code you are using there.

Locates the first, last, next, or previous record in a dynaset- or snapshot-type Recordset object that satisfies the specified criteria and makes that record the current record (Microsoft Jet workspaces only).


Example from the help file:
Set rstCustomers = dbsNorthwind.Op enRecordset( _
"SELECT CompanyName, City, Country " & _
"FROM Customers ORDER BY CompanyName", _
dbOpenSnapshot)
Mar 27 '07 #2
LMHelper
12 New Member
What type of recordset did you open? Show us the code you are using there.

Locates the first, last, next, or previous record in a dynaset- or snapshot-type Recordset object that satisfies the specified criteria and makes that record the current record (Microsoft Jet workspaces only).


Example from the help file:
Set rstCustomers = dbsNorthwind.Op enRecordset( _
"SELECT CompanyName, City, Country " & _
"FROM Customers ORDER BY CompanyName", _
dbOpenSnapshot)
The error I am stuck on now is Error 3251 which then brings me into a code window that states the following is not working and needs to be debugged:
rst2.FindFirst "[usedfpnumber] = " & varFPNum 'dcr 87 5 lines
Mar 27 '07 #3
Denburt
1,356 Recognized Expert Top Contributor
The error I am stuck on now is Error 3251 which then brings me into a code window that states the following is not working and needs to be debugged:
rst2.FindFirst "[usedfpnumber] = " & varFPNum 'dcr 87 5 lines

I got this I need more code/info if I am going to help. There are several issue that can cause this.

I will take a stab though.
In your Declaration section do you see something like this:

Dim db as database
Dim rst2 as recordset

If you do try changing it to read:
Dim rst2 as Dao.recordset

I am pretty sure Dao is the default but it might depend on the order of your references.

Another thing that could cause this is declaring the recordset to something other than a snapshot or dynaset as per the help file comment that I posted

Expand|Select|Wrap|Line Numbers
  1. Example from the help file:
  2. Set rstCustomers = dbsNorthwind.OpenRecordset( _
  3. "SELECT CompanyName, City, Country " & _
  4. "FROM Customers ORDER BY CompanyName", _
  5. dbOpenSnapshot
  6.  
These are two of the more common causes but I only know what you have told me so far. I will be more specific and ask you to post your declaration statement and the line that opens your recordset (should look similar to the one from the example above).
Mar 27 '07 #4
ADezii
8,834 Recognized Expert Expert
I am in the process of switching an Access Database that was originally designed in Access 97 and they need it to switch over to Access 2000-2003 Database Version. We have run into errors when moving it over (converting). The error I am stuck on now is Error 3251 which then brings me into a code window that states the following is not working and needs to be debugged:
rst2.FindFirst "[usedfpnumber] = " & varFPNum 'dcr 87 5 lines
I checked the table in use where this information is coming from and it has the correct information in it. The tableinUse table from the 97 version has the same information and set up as the new database copy in 2000-2003. Not sure why I'm getting this error and what to change in it.

Can someone assist me in some way as to what to look for?
I don't think that it is anything more sinister than Syntax. A String Variable must be enclosed within single Quotes as in:
Expand|Select|Wrap|Line Numbers
  1. rst2.FindFirst "[LastName]='" & strName & "'"
Mar 27 '07 #5
Denburt
1,356 Recognized Expert Top Contributor
Still just poking in the dark but something to look for is a missing reference, upgrades can cause this. Probably the first thing you should do, in the VBA window go to tools then references and look for any that have missing next to it. If you went straight from 97 to 2003 this is a good possibility if I remember correctly these will be different versions. If this is the case uncheck it and scroll down till you see "Microsoft DAO 3.6 object Library" I like to move mine up to the third position from the top.

Well you have some ideas good luck let us know...
Mar 27 '07 #6
nico5038
3,080 Recognized Expert Specialist
1) Make sure that the reference (Open Tools/References when in VBA) to Microsoft Active Data Objects (default for your Access version) is unchecked
2) Make sure that Microsoft DAO version #.## is checked
3) Use for the opening of the recordset:

set rs2 = currentdb.openr ecordset("<tabl ename or select statement>")

Nic;o)
Mar 28 '07 #7
LMHelper
12 New Member
What I am copying below is the entire SECTION that the problem is in. What is in bold is the error I am being brought to debug. Error 3251.


Sub ProcessFP(strSo urce As String, varFPNum As Variant, strFPNum As String) ' reww 072902 dcr 107
' reww created 10/26/01 to carry out functions formerly assigned to the GO button,
' which may or may not be on the form. strSource is from the label proc, and varFPNum is the numeric
' version of the FP number from the parse routine.
' This proc is new, but borrows and revises code from the 2 GO buttons, which this replaces.
' dcr 87 changes made beginning 7/8/02 reww

Dim strFPAction As String ' This specifies C, create, or U, update
Dim strFPType As String ' This is PTR or CR as appropriate
Dim strUpdErr1, strUpdErr2, strCreateErr As String
Dim db As Database
Dim rst, rst2 As Recordset ' dcr 87, added second recordset for tblInUse
Dim sql, strBldName As String
Dim intResponse As Integer ' msgbox function response value
Dim wksp As Workspace 'dcr 87 change
Set wksp = DBEngine(0)


strFPAction = Left(strSource, 1)
strFPType = Right(strSource , Len(strSource) - 1)

strUpdErr1 = "You have requested to update a " & strFPType & " Fixpackage which does not exist" _
& " in the requested build." & vbCrLf & "Please either create this " & strFPType & " Fixpackage or put in the " _
& "number of an existing " & strFPType & " Fixpackage."

strUpdErr2 = "You have requested to update a " & strFPType & " FixPackage, but the Release" _
& vbCrLf & "Name is incorrect for this " & strFPType & " FixPackage." & vbCrLf & _
"Click YES to update the selected " & strFPType & " FP and correct the Release Name." & vbCrLf _
& "Click NO to leave the Release Name as is and correct the " & strFPType & " Number." & vbCrLf _
& "Click CANCEL to erase both and start over."

strCreateErr = "You have requested to create a " & strFPType & " Fixpackage which already exists." _
& vbCrLf & "Please either update this " & strFPType & " Fixpackage or put in the " _
& "number of a new " & strFPType & " Fixpackage."

Set db = CurrentDb

'find the FP matching the number entered, checking only non-failed items
sql = "SELECT tblHeader.* FROM tblHeader WHERE (([strBuildName]= " _
& "'" & Me.txtBuildName & "') AND ([strStatus] <> 'Fail') AND ([strstatus] <> 'Fail-R')" _
& " and ([strPTRorCR]= " & "'" & strFPType & "'))"

Set rst = db.OpenRecordse t(sql)
Set rst2 = db.OpenRecordse t("tblInUse") 'dcr87 define the recordset for tblInUse

rst.FindFirst "[intFPNo] = " & varFPNum
'msgbox strFPType & " " & varFPNum & " " & strFPAction

rst2.FindFirst "[usedfpnumber] = " & varFPNum 'dcr 87 5 lines
If Not rst2.NoMatch Then
MsgBox "The FP requested, " & rst2!UsedFPN & " is in use."
Exit Sub
End If

' The following code implements a decision tree, using strFPAction to determine update or create.
' If no match, and strFPAction is U, then display error msg
' If no match, and strFPAction is C, then create the fixpackage
' If a match, and strFPAction is U, then update the fixpackage, checking release name, too
' If a match, and strFPAction is C, then display error msg
' In the following Msgboxes, vbCrLf is a carriage return and line feed
If rst.NoMatch Then
If strFPAction = "U" Then 'error trying to update an unknown cr or ptr
MsgBox strUpdErr1
Else ' go to PTRMain form to create a new FP, since strFPAction = "C"
DoCmd.OpenForm "frmPTRMain ", , , , , , strFPAction & varFPNum & strFPType & Me.txtBuildName 'jb 9/4 Change# 100.
rst2.AddNew ' dcr 87 6 lines
rst2!UsedFPNumb er = str(varFPNum)
rst2!UserName = wksp.UserName
rst2!UsedBuild = rst!strBuildNam e
rst2!UsedFPN = strFPNum 'reww 072902 dcr 107
rst2.Update
'Me.txtBuildNam e = "None Selected"
DoCmd.Close acForm, "frmWelcome ", acSaveNo
End If
Else ' an FP match is found
'Now to first double check the build NAME (not ID!)
'Check the build name from the recordset against the build name from the welcome form
If strFPAction = "U" Then 'go to ptrmain form for update
strBldName = rst!strBuildNam e
If strBldName <> Me.txtBuildName Then 'Check for bad match of build names
intResponse = MsgBox(strUpdEr r2, vbYesNoCancel + vbInformation, "Fixpackage ")
Select Case intResponse
Case vbYes ' Keep FP, use Correct Build Name
Me.txtBuildName = strBldName
Case vbNo ' fix FP number
'Me.cboSelectCR List.Visible = True
'Me.lblCRList.V isible = True
'Me.txtGetCRNum .SetFocus
'Exit Sub
Case vbCancel ' start over
Me.txtBuildName = "None Selected"
Me.txtBuildName .SetFocus
Exit Sub
End Select 'intresponse
End If 'Check for match of build name
rst2.AddNew 'dcr 87 6 lines
rst2!UsedFPNumb er = str(varFPNum)
rst2!UsedBuild = rst!strBuildNam e
rst2!UsedFPN = rst!strComplete
rst2!UserName = wksp.UserName
rst2.Update

DoCmd.OpenForm "frmPTRMain ", , , , , , strFPAction & varFPNum & strFPType & Me.txtBuildName 'jb 904 Change# 100
'Me.txtBuildNam e = "None Selected"
DoCmd.Close acForm, "frmWelcome "
Else 'error trying to create an FP which exists
MsgBox strCreateErr
lblCreateCRFP_C lick
End If 'strFPAction = "U"
End If 'rst.NoMatch



End Sub
'jb 4/24/02 added entire subroutine
Private Sub lblKeysite_Clic k()
'DoCmd.OpenForm "frmKeysiteList " 'jb 11/16
DoCmd.OpenForm "frmKeysiteSele ct"
DoCmd.Close acForm, "frmWelcome ", acSaveNo
End Sub
Mar 30 '07 #8
Denburt
1,356 Recognized Expert Top Contributor
O.K. code is good but before we can continue it is pertinent that you reply to the following. We have to start at the top and work our way down.


in the VBA window go to tools then references and look for any that have missing next to it. If you went straight from 97 to 2003 this is a good possibility if I remember correctly these will be different versions. If this is the case uncheck it and scroll down till you see "Microsoft DAO 3.6 object Library"
You should see "Microsoft DAO x.x object Library" If not then.... Let us know about this info please, thanks.
Mar 30 '07 #9
LMHelper
12 New Member
Ok so I went into Tools/References and made sure that my 3.6 was checked and it is. Seems all ok so I don't understand why I keep getting this error.
Apr 2 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

6
4246
by: Mike Wiseley | last post by:
We recently converted our department wide shared Access97 database to Access2K. We used to be able to open various reports in design mode and make changes to the design (or create new reports) even while other users in this shared database might be using other, unrelated reports. Now, in Access2k, it appears that whenever you do not have...
2
1840
by: Rob | last post by:
Apologies if this is a frequently asked question but i haven't been able to find a satsifactory answer anywhere else at the moment. My problem is that i'm trying to convert an Access97 database to sql Server 2000 using the Import and Export Data wizard. I can see the list of tables but get read access errors when trying to convert them. I...
1
1388
by: Tom LeBold | last post by:
Do White papers or other documents exist that explain the steps to converting an Access database and/or tables to SQL 2000.
1
2628
by: Mario Crevits | last post by:
My name is Mario Crevits, I'm from Belgium (Roeselare) and I'm working with Access97 for several years now. We are in an Access97-2000 migration project. I'm writing a wizard for the end-users to automatically find and convert their Access97 databases on a specific drive. I want to convert the databases through VBA : 1. create an empty...
5
1583
by: ken | last post by:
I had to reinstall Windows 2000 Pro and of course Access 2000. I HAD each record displaying a photo but now it does not show them. The WEIRD thing is that when I upload the database to my website...the image shows up! Is there a setting in Access that I need to chnage because of the reinstall? Thanks. Ken
19
5406
by: adirat | last post by:
I have read a lot on this subject on newsgroups and other access related websites on data corruption, but since we are still not able to isolate the problem – I am posting this detailed explanation of my problem: We have a 23 user environment with Windows advanced server and windows 2000 clients with access 2002 running on all clients in a...
3
2612
by: JMCN | last post by:
hello i am in the midst of converting all of the "inherited" databases from access 97 to access 2000. one of the issues i have is the basic one: dao.recordset. i have read that i need to simply turn off the ADO reference and change the reference ms dao 3.6 object library to ms dao 3.51 object library or "disambiguate the code". i tried both...
9
1312
by: tina1 | last post by:
I am very new with Microsoft Databases, so know very little. This may be a dumb question, but need help. Here's my question - I emailed myself a database from work to home to do some of my work at home over the long weeken, my home version is MSAccess97, my work version is Office2000. Is there a website that will convert this database from...
2
2123
by: Mark Flippin | last post by:
I'm converting the backend of an Access 2000 database to SQL Server 2000. The existing database has user and group security through a specific workgroup file. Under the "user and group accounts" there is a button to print the users and group relationships. As there are only about 50 authorized users and 6 groups, this has worked.
7
2982
by: timmso | last post by:
I'm using Ado.net in an asp.net project with an Access backend. Whenever I try to do a simple Select or Update, I inevitably see the error "Unrecognized database format". I'm using Access 2000. Here is some code for an aspx page: Sub Page_Load(Source As Object, E As EventArgs) Dim strConnection As String =...
0
7496
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7428
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7685
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
5354
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5071
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3485
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1039
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.