ODBC-MS Access Connection Call Failed Error 3146 (1 Viewer)

Irwan

New member
Local time
Today, 19:37
Joined
Oct 22, 2025
Messages
2
hello VB expert,

i am new in VB and need an advice.

i am trying to get actual value from Long Binary Data.
The Long Binary Data is stored in software database (the database is in network system) which i export using ODBC to MS Access.
After export to MS Access, i need to translate the Long Binary Data into actual value using VB.
Here is the code provided by the vendors, but it keeps give me error.
1761095194280.png

1761095601960.png

really appreciate if anyone can show how to solve this error.

Thank you.
 
What does the Long Binary Data holds, image, pdf, what?
 
hello arnelgp,

it stored waveform/spectral data like time/frequency and its amplitude.
1761109198990.png

The goal is to extract the highlight yellow.

Really appreaciate for the help.
Thank you.
 
how many records does rs holds when you open the recordset? only 1?
after this line:
Code:
Set rs = db.OpenRecordset("Select RawData, LineResolution From VibSpectra Where SpectraKey = ...)
insert this line to save the Rawdata to a file (RawData.bin)
Code:
chunk = rs("RawData")
' arnelgp
Dim fileNum%, filePath$
filePath = Environ("Userprofile") & "\Documents\RawData.bin"
fileNum = FreeFile
Open filePath For Binary Access Write As fileNum
Put fileNum, , chunk
Close fileNum
Exit Sub
'end arnelgp
now you can post the RawData.bin (saved in your Documents)
so we can examine the structure (or if you know the Structure, tell us what it is).
 
I have some doubts whether OpenDatabase works with an ODBC connection string.
If it ever worked, it probably was part of the ODBC Direct functionality, which was removed with the switch from JET to ACE in A2007.

You can check the DBEngine.Errors collection for a more meaningful error message.

If OpenDatabase is the problem here, you could use a pass-through query as an alternative to query the data.
 
or you can try ADO.Connection/Recordset
 

Users who are viewing this thread

  • Back
    Top Bottom