Connecting with paradox file..

R

Ricardo Magalhaes

Hi,

I´m trying to connect with a paradox database from my windows dot net
application(vb.net) and web application(asp.net) using odbc driver. vb.net
project works fine, but the asp.net it doesn´t. The following code is the
same from both, except the way to display the error messenger..

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim objConn As Odbc.OdbcConnection
Dim objcmd As New Odbc.OdbcCommand
Dim objDr As Odbc.OdbcDataReader
Dim sConnString As String = "Driver={Microsoft Paradox Driver
(*.db )};DriverID=538;Fil=Paradox
5.X;DefaultDir=D:\TEMP;Dbq=D:\TEMP;CollatingSequence=ASCII"

objConn = New Odbc.OdbcConnection(sConnString)
Try
objConn.Open()
objcmd.Connection = objConn
objcmd.CommandType = CommandType.Text
objcmd.CommandText = "select ALU_NOME from ALU20051"
objDr = objcmd.ExecuteReader()
If objDr.Read Then ' Matricula Válida
MsgBox(objDr("ALU_NOME"))
Else ' Matricula Inválida
MsgBox("nao encontrado")
End If

Catch ex As Exception
MsgBox(ex.Message)

Finally
objConn.Close()
objConn = Nothing

objDr.Close()
objDr = Nothing
End Try

End Sub

The error messeger was

Exception Details: System.Data.Odbc.OdbcException: ERROR - no error
information available
Source Error:
Line 38:
Line 39: 'Try
Line 40: objConn.Open()
Line 41: objcmd.Connection = objConn

I try with odbc dot net driver (microsoft.data.odbc.dll) but it doesn´t work
too.

Help me. I'm quit get desperate..

Thanks a lot..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top