Access Database - Connect to External Hardware

PaulO

Registered User.
Local time
Today, 09:08
Joined
Oct 9, 2008
Messages
421
I have an existing Access database application that I have been asked whether I could connect, via USB, to an external security system from which to read and store data.

At this stage pretty much all I know is that there is a DLL file that will create .TXT files that my database would then be able to read and convert into usable data.

Has anyone any experience or knowledge in this area?

e.g. VB code to pass commands to the external hardware (using/via the DLL perhaps) and calling/creating the required TXT files?
 
the first step I use when working with third-party DLLs is to see if there is a SDK available from the developer of the DLL.
 
Yes I have a copy of this plus other documents ...
 
Haha it would be good if it made any immediate sense. There's a lot of sample code to call various commands and I'm hopeful it is directly usable in VB in Access. I'm also waiting on delivery of the hardware, just trying to get some sense in my mind as to how it'll all work.
 
Haha it would be good if it made any immediate sense. There's a lot of sample code to call various commands and I'm hopeful it is directly usable in VB in Access. I'm also waiting on delivery of the hardware, just trying to get some sense in my mind as to how it'll all work.

I have used several custom controls/DLLs with Access.

To give you an example of how to with a DLL, here is an example I have posted using a DLL to work with ZIP files.


ZIP and Unzip from within your Access Database

Hope this helps ...
 
I like the ZIP and UNZIP routines a lot and managed to get them working. I even added a browse path utility to the UNZIP element. One question ... is there a variant that would permit multiple files and/or a folder to be selected and zipped, rather than just one file?

I have now received the hardware from the manufacturer and once I have it all hooked up I can then perhaps start assessing how I call and read data from it. Your use of the DLL file to ZIP and UNZIP has given me some seeds of thought but it will be an interesting time ahead as I grapple with VB code and external hardware!
 
OK ... just starting to get into this ... there is lots of example code within the SDK one of which which I have copied into VB behind a Form Command Button in my Access Database.

Whilst the code didn't entirely bomb out I got an error message which I'm not understanding? (see .doc attachment)

What am I missing?

Any thoughts would be so appreciated!
 

Attachments

This part:
Code:
    Declare Function uniDownloadAdministrationData _
     Lib "unikonDrv.dll" (ByVal lpFileName As String) As Integer

Does not go in the click event. It needs to go into the Declarations Section of a STANDARD MODULE.
 
Hmm ... many thanks for that!

Just prior to your posting I had copied all the Functions exported by the DLL into a MODULE, including the one in the above example.

So, now that all the Functions exist in a Module, how do I call each one if not with a command button? (Sorry if that's a real dumb question but I gotta ask all the same you'll understand)

 
Hmm ... many thanks for that!
So, now that all the Functions exist in a Module, how do I call each one if not with a command button? (Sorry if that's a real dumb question but I gotta ask all the same you'll understand)
You had the right terminology...
Code:
Call YourFunctionOrSub
 
The SDK includes the following (but the Syntax when used gets the error "Compile error : Invalid Outside procedure" when referring to the MODULE I created) ... I think I'm missing something obvious?

Syntax


int uniDownloadAdministrationData(
const char* lpFileName
);




Parameters


lpFileName


[in] Pointer to a null terminated string containing the name of the file to take downloaded data




Return Values


The function returns an int.
 
Attached is the error message I'm now getting ... can't get around it.

Access clearly doesn't like the statement in red font either?

Public Delegate Function userCallBackFunctionPtr(ByVal statusInfo As Integer, ByVal Counter As Integer) As Integer

Any thoughts greatly appreciated ...
 
Just coming back to this project after a few weeks away on business ... anyone with an idea please throw it into the ring. :)
 

Users who are viewing this thread

Back
Top Bottom