06-02-2006 11:02 AM
Using the following VBScript I’ve exported from Access creates an error.
Attribute VB_Name = "Converted Macro- serial_port_configuration_2"
Option Compare Database
Option Explicit
Function serial_port_configuration_2()
On Error GoTo serial_port_configuration_2_Err
DoCmd.OpenForm "setup_serial", acNormal, "", "", , acNormal
serial_port_configuration_2_Exit:
Exit Function
serial_port_configuration_2_Err:
MsgBox Error$
Resume serial_port_configuration_2_Exit
End Function
Script: C:\My Code\Converted Macro-serial_port_configuration_2.vbs
Line: 2
Char: 1
Error: Expected statement
Code: 800A0400
Source: Microsoft VBScript compilation error
06-05-2006 12:30 PM
06-05-2006 01:10 PM
I am using the Database Connectivity Toolkit to preform operations on Access tables. I have created forms that I'd like to open from LabVEIW. My plan is to use the macro created by Access as I know of no way to open a form using the Database Connectivity Toolkit. the toolkit seems to have the tools to create, write and querry tables but no way to open forms or reports created in Access. I would like to use the Access forms and reports as it is much easier to create the forms and reports in Access than it is in LabVIEW.
I’ve also tried to use ActiveX to open the form with no success. I am using the methods DDEInitiate, DDEExecute , and the command DoCmd.OpenForm “Setup_serial”.
The ActiveX attempt resulted in the following error:
Error Code: -2146828003
Exception occured in MSAccess: The other application can't perform the DDE function or retrieval you attempted.@The other application doesn't recognize the data or commands you supplied, or it doesn't recognize the item argument, based on the defined topic of the conversation.@Check the application's documentation to see what data or commands it recognizes.@1@@1Help Path is and context -1 in set up interface 2.vi
06-06-2006 05:06 PM
06-07-2006 10:07 AM
I was able to get LabVIEW to open the Access forms using scripts. I used a product called Onscript to figure out how the scripts work. Once I understoood the scripts I was able to open the forms in LabVIEW using an automation ref for Access and the same methods and properties used in the scripts. Once I understood how things worked, the activeX controlls were easy to use and are a better solution than the scripts.
Now I'm trying to figure out how to get the forms to open on the top level. They open but the LabVIEW panel remains on top. I've tried using activeX controls to minimize the LabVEIW panel but it only affects the panel at start up, not while the vi is running.
06-07-2006 03:35 PM