Guest_imported
New member
- Jan 1, 1970
- 0
I could create a DSN by doing this in VB:
sDriver = "Pervasive ODBC Engine Interface"
sAttributes = "Server=" & servername & Chr$(0)
sAttributes = sAttributes & "DESCRIPTION=AMSI Conversion DSN" & Chr$(0)
sAttributes = sAttributes & "DSN=" & sDSN & Chr$(0)
sAttributes = sAttributes & "OpenMode='NORMAL'" & Chr$(0)
sAttributes = sAttributes & "IS_ENGINE_DSN=False" & Chr$(0)
sAttributes = sAttributes & "IS_SYSTEM_DSN=True" & Chr$(0)
sAttributes = sAttributes & "DATABASE=" & sDB & Chr$(0)
sAttributes = sAttributes & "UID=" & username & Chr$(0)
sAttributes = sAttributes & "PWD=" & password & Chr$(0)
DBEngine.RegisterDatabase "SOMETHING", "Pervasive ODBC Engine Interface", True, sAttributes
nRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_DSN, sDriver, sAttributes)
If nRet = 0 Then
'CreateDSN SuccessFull
'Create Tables in Pervasive Database
Else
MsgBox ("Error Creating DSN"
End
End If
It does create the DSN (which is User DSN).
1. Question is how can I create a System DSN.
I tired this:
sAttributes = sAttributes & "IS_ENGINE_DSN=False" & Chr$(0)
sAttributes = sAttributes & "IS_SYSTEM_DSN=True" & Chr$(0)
which does help.
2. Is it the same process for Pervasive to connect to the db
and create tables using sp like we do for SQL Server? because we do this in SQL
Set oCon = goPackage.Connections.New("SQLOLEDB.1"
oCon.Name = "Microsoft OLE DB Provider for SQL Server"
oCon.ID = 2
oCon.Reusable = True
oCon.ConnectImmediate = False
oCon.DataSource = servername
oCon.UserID = username
oCon.password = password
and so forth...in pervasive do we have something like this.
If ANYONE has any kinda info...please lemme know. Thank a mil. RK
sDriver = "Pervasive ODBC Engine Interface"
sAttributes = "Server=" & servername & Chr$(0)
sAttributes = sAttributes & "DESCRIPTION=AMSI Conversion DSN" & Chr$(0)
sAttributes = sAttributes & "DSN=" & sDSN & Chr$(0)
sAttributes = sAttributes & "OpenMode='NORMAL'" & Chr$(0)
sAttributes = sAttributes & "IS_ENGINE_DSN=False" & Chr$(0)
sAttributes = sAttributes & "IS_SYSTEM_DSN=True" & Chr$(0)
sAttributes = sAttributes & "DATABASE=" & sDB & Chr$(0)
sAttributes = sAttributes & "UID=" & username & Chr$(0)
sAttributes = sAttributes & "PWD=" & password & Chr$(0)
DBEngine.RegisterDatabase "SOMETHING", "Pervasive ODBC Engine Interface", True, sAttributes
nRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_DSN, sDriver, sAttributes)
If nRet = 0 Then
'CreateDSN SuccessFull
'Create Tables in Pervasive Database
Else
MsgBox ("Error Creating DSN"
End
End If
It does create the DSN (which is User DSN).
1. Question is how can I create a System DSN.
I tired this:
sAttributes = sAttributes & "IS_ENGINE_DSN=False" & Chr$(0)
sAttributes = sAttributes & "IS_SYSTEM_DSN=True" & Chr$(0)
which does help.
2. Is it the same process for Pervasive to connect to the db
and create tables using sp like we do for SQL Server? because we do this in SQL
Set oCon = goPackage.Connections.New("SQLOLEDB.1"
oCon.Name = "Microsoft OLE DB Provider for SQL Server"
oCon.ID = 2
oCon.Reusable = True
oCon.ConnectImmediate = False
oCon.DataSource = servername
oCon.UserID = username
oCon.password = password
and so forth...in pervasive do we have something like this.
If ANYONE has any kinda info...please lemme know. Thank a mil. RK