Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create DSN, Tables

Status
Not open for further replies.

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
 
Ric, you should go to the Pervasive Developer Center and join to get a copy of the latest SDK. It has samples for all of this. You can also use Pervasive's DevTalk forum to get samples from PVSW staff.

Regards,
Pervasivite
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top