Hi, unfortunately this has to do with the C calling convention used by sqlite3.dll. By default DLLs compiled with C have the cdecl calling convention, but VB only supports the stdcall calling convention.
You must recompile sqlite using MS Visual C++ or other compiler and switch the default calling convention from cdecl to stdcall in the compiler/linker settings. HTH Michael > >hello i'm trying to open a database with VB6 without wrapper > >i'm using sqlite3.dll > >and it's my code : > >Option Explicit >Private Declare Function sqlite3_open Lib "sqlite3.dll" (ByVal filename >As String, ByRef dbHandle As Long) As Long >Private Declare Function sqlite3_open16 Lib "sqlite3.dll" (ByVal >filename As String, ByRef dbHandle As Long) As Long >Private Declare Sub sqlite3_close Lib "sqlite3.dll" (ByVal DB_Handle As >Long) > >Private Sub Form_Load() > Dim lRet As Long > Dim lDbHandle As Long > Dim sFilename As String > > sFilename = "c:\toto.db" > sqlite3_open sFilename, lDbHandle > MsgBox ("lRet=" & lRet) > MsgBox ("ldbhandle=" & lDbHandle) > sqlite3_close (lDbHandle) >End Sub > >when i launch it, i've an error 49 : Bad DLL calling convention > >anyone can help me ? where is my fault ? > >thx >Gregory Letellier > >