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..
 
P

Philip Hristov

Ricardo,

Maybe this is because Paradox is file based database...and we all know
about .NET security especially in ASP.NET. Maybe this caused your
problem. Why do not place your .db file (along the other files which
are part of the database) in your application folder, but I doubt that
this will work. There is one paradox.net which must be accessed too...

See what I have find -
http://forums.aspfree.com/archive/t-39935/Paradoxnet-ODBC-error-in-WEB-application

The second poster claims that he solved the problem, but he do not
explains what he exactly did...

I hope you will be able to solve your problem.

Best,

Philip.
 
P

Paul Clement

¤ 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..
¤

Likely a permissions problem. If you're not using impersonation, try giving the ASPNET account
sufficient permissions to access the file. The following would also apply to a Paradox file:

http://support.microsoft.com/default.aspx?scid=kb;en-us;316675


Paul
~~~~
Microsoft MVP (Visual Basic)
 

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

Top