VBA RSVIEW issue

rbnice1

Member
Join Date
Feb 2007
Location
st.louis
Posts
28
Need a bit of help. I have a older rsview app running on Windows nt that runs fine. My clients wanted to update and now the same project will not run correctly. The display screen I am having an issue with is a simple recipe screen. They are loading recipes that are based in access into a text box. I tried to step through the VBA code and it appears it is erroring out on the first line "Set RecipeDb = OpenDatabase(DatabasePath & "CookOnStove.mdb", False, False)
"

They must have changed something between revisions but I am unsure. Here is a copy of the code. Do any of you see why this no longer works when it worked fine?

RecipeDB is defined as Database
RecipeRs is defined as Recordset



On Error GoTo ErrHandler
Set RecipeDb = OpenDatabase(DatabasePath & "CookOnStove.mdb", False, False)

' Select Name of Recipe
SQLStmt = "Select * from Recipes Order By RecipeName"

Set RecipeRs = RecipeDb.OpenRecordset(SQLStmt)
If Screen = "RecipeSel" Then
gCommand.Execute "Invoke Recipe.ListBox1.Clear"
LBox = "Invoke Recipe.ListBox1.AddItem("
ElseIf Screen = "RecipeEdit" Then
gCommand.Execute "Invoke RecEdit.RecipeList.Clear"
LBox = "Invoke RecEdit.RecipeList.AddItem("
End If

Do While Not RecipeRs.EOF
test1 = RecipeRs!RecipeName
gCommand.Execute LBox & Chr$(34) & test1 & Chr$(34) & ", -1)"
RecipeRs.MoveNext
Loop

ErrHandler:
'Build a log message
sMsg = "RSView32 VBA Error; Sub: GetRecipes, " & Err.Number & ":" & Err.Description
'Log the error to the Activity Log
gActivity.Log sMsg, roActivityError, , , "Confirm()"

'Print error message to Immediate window in VBA editer
Debug.Print "RSView32 VBA Error " & Err.Number & ":" & Err.Description
MsgBox sMsg
Exit Sub

End Sub
 
ApplicationPAth = gProject.Path
DatabasePath = applicationPath & "\Recipes\"

Error is 429:activeX component can't create object. But the line is only loading that database so I am not sure that is a valid code.
 
from http://answers.microsoft.com/en-us/...t-create/481475c9-4ed6-4211-be6b-2431b962b257

Normally, runtime error 429 appears when you try to automate office applications on Windows systems. If the requested Automation object can not be created by the Component Object Model properly, it would be unavailable to Visual Basic. That is why such error message displaying on your computer. To fix the error 429 issue, you should check that if the Office application you are using is installed on the local system and that you are able to run the application manually at first. Next step you need to take is to re-register registry entries of the Office applications one by one. For example, to re-register Microsoft Office Word, in the Run dialog box, type C:program Files/Microsoft Office/Office/Access.exe /regserver and press OK.

This may help ...
 
Maybe just the DAO350.DLL needs registered:

RegSvr32 C:\progra~1\common~1\micros~1\dao\dao350.dll
at the command prompt...
 
Cant find access.exe im using office 2010.

I was able to register dio350.dll and no luck. It continues to fall on its face with the opendatabase function. Did they change how this function works? When I google it it shows people using workspace along with it and I am not.
 
No, I have a lot of VB code that does just like your code does it.
In your project do you have a reference set to the Microsoft Office 12.0 Access database Engine Object library? (Not sure your access 2010 is 12.0 or otherwise)

And, have you changed anything? It's odd that you would have access 2010 running on an NT machine.
 
no this is on my laptop that has win 7. The rsview screens work fine on the NT computer. Just not on any of the new upgraded PC's
 
so,
In your project do you have a reference set to the Microsoft Office 12.0 Access database Engine Object library? (Not sure your access 2010 is 12.0 or otherwise)
You may need a reference to a different library to use on your laptop or upgraded PC's

This site confirms the difference in the references you should set in your VBA project:
http://hitechcoach.com/index.php?op...-library-in-access-2007-and-2010&catid=27:vba
 
Fantastic! IT it now working correctly on my laptop. Only problem now is on the floor they are running xp with office 2003 and it will not load the screen. I assume its because it needs Microsoft Office 12 access database engine object library. I only have office 14.0 on my laptop. Not sure how to load the other.
 
This Microsoft site says you can download the Microsoft Access Database Engine 2010 Redistributable. and the description is
"This download will install a set of components that can be used to facilitate transfer of data between 2010 Microsoft Office System files and non-Microsoft Office applications."
http://www.microsoft.com/en-us/download/details.aspx?id=13255

but it seems like I tried this on a project with no joy, but maybe you could try it...
you may have issues like the laptop locations are "C:\Windows\SysWOW64" and the locations on your NT machine would likely be "C:\Windows\System32" so the DLL might not get located properly ...
 
Last edited:
Just want to thank you again. I did have dao3.6 and when I loaded it the other PC worked like a champ. I did not think I was ever going to get it. So again thanks much!
 

Similar Topics

Hello there, I'm new at the forums and with HMI programming and would like to ask for some help. I'm having trouble migrating a VBA code from...
Replies
1
Views
3,093
I have a global object that is a group of a series of objects one of which is a button. The push of the button needs to execute a VB script based...
Replies
0
Views
4,700
Hallo, I got a Cognex Scanner for dormatrix code. I want to read it in a RSView 32 Application. Therefore I need a VBA Code. Did anybody from...
Replies
0
Views
1,951
In RSView we have the operators read in several pieces of information from a barcode reader. None of the bar codes have any tab, CR, LF, or any...
Replies
4
Views
3,125
I'm using RSView VBA to record the last parameter adjustments made for a given product in an MS Access data base. The Access table contains...
Replies
4
Views
2,338
Back
Top Bottom