I'm writing in
VB
I was creating the System DSN's through the ODBC Data Source Administrator
I have code that will create an access DSN i just can't get it to work with the Pervasive ODBC Engine Interface
Here is the code I have now.
Option Compare Database
Option Explicit
Const ODBC_ADD_SYS_DSN = 4 'Add data source
Private Declare Function SQLConfigDataSource Lib "ODBCCP32.DLL" (ByVal _
hwndParent As Long, ByVal fRequest As Long, ByVal _
lpszDriver As String, ByVal lpszAttributes As String) As Long
Function Build_SystemDSN()
Dim ret%, Driver$, Attributes$
Dim DSN_NAME As String
Dim Db_Path As String
Dim DB_Name As String
DSN_NAME = "TestA"
DB_Name = "test"
Db_Path = "C:\"
'Driver = "Microsoft Access Driver (*.mdb)" & Chr(0)
Driver = "Pervasive ODBC Engine Interface" & Chr(0)
Attributes = "DSN=" & DSN_NAME & Chr(0)
Attributes = Attributes & "Uid=" & Chr(0) & "pwd=" & Chr(0)
Attributes = Attributes & "DBQ=" & DB_Name & Chr(0)
' Attributes = Attributes & "OPENMODE=0" & Chr(0)
' Attributes = Attributes & "DDFPATH=" & Db_Path & Chr(0)
ret = SQLConfigDataSource(0, ODBC_ADD_SYS_DSN, Driver, Attributes)
' ret is equal to 1 on success and 0 if there is an error
If ret <> 1 Then
MsgBox "DSN Creation Failed"
End If
End Function
I can get it to create the Access system DSN but not the pervasive System DSN. I went to the pervasive site and it said the Engine interface only needed the Driver, DSN, UID, and PWD.
I'm trying to connect to DDF files that are from MPM 3.0. I was going to try and use Pervasive.slq V8 it has ole db capabilities, but the people at Business Engine said I cannot use the Pervasive.slq V8 it will not work with the current version of MPM.
Thanks
Animaul