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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing Pervasive.SQL V8 with VB.NET 2005

Status
Not open for further replies.

JDPglenman

IS-IT--Management
Jan 23, 2007
16
IE
Hi,

I am having problems connecting a simple application written in VB.NET (2005) with our Pervasive.SQL V8 database. I have attempted three methods:

1. using OdbcConnection - the application works fine but remains in memory when closed. This happens only when I populate a DataSet object using a DataAdapter object.
2. using ADODB.Connection - the connection works ok and the application closes down ok, but I cannot use the Recordset.MoveLast method to move to the end of the recordset.
3. using OleDb.OleDbConnection I get an "Invalid user authorization specification." error message from Pervasive ODBC Engine

Can anyone tell me help?

Thanks in advance

Jeremy
 
I would recommend using the PSQL Managed Provider and the PsqlConnection from Pervasive (The code is very similar to the OdbcConnection:
Here's a simple console application (save the file as "simpleadonetvb.vb"):
Code:
Imports Pervasive.Data.SqlClient

Module Module1

    Sub Main()
        Dim conn As New PsqlConnection("ServerDSN=DEMODATA")
        Dim cmd As New PsqlCommand("select id,name from class", conn)
        conn.Open()
        Dim dr As PsqlDataReader
        dr = cmd.ExecuteReader
        While (dr.Read)
            Console.WriteLine("ID: " & dr("id").ToString() & " -- " & "Name: " & dr("name").ToString())
        End While
        dr.Close()
        conn.Close()

    End Sub

End Module

and the command line to compile it:
Code:
vbc /target:exe /r:c:\pvsw\pervasive.data.sqlclient.dll simpleadonetvb.vb



Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
Thank you for your assistance. I will give your suggestion a go today and see if it helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top