bert aalders
Member
- Joined
- Mar 4, 2011
- Messages
- 16
- Programming Experience
- Beginner
i am new at VB, i used to programm in Delphi.
now i want to convert my program to VB.
In Delphi it is simpel to connect to a database.
In VB i can not get this right.
What am i doing wrong:
code:
Public Class klant
Private Sub klant_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim odbcverbinding As OdbcConnection
Dim prdxconnString As String = "Driver={Microsoft Paradox Driver (*.db )};DriverID=538;Fil=Paradox 5.X;DefaultDir=E:\nog uit pakken\projecten\;Dbq=E:\nog uit pakken\projecten\;CollatingSequence=ASCII"
odbcverbinding = New Odbc.OdbcConnection(prdxconnString)
odbcverbinding.Open()
Dim str As String
str = "select * from test"
Dim ODBCadp As New OdbcDataAdapter(str, odbcverbinding)
Dim dt As New DataTable("test")
ODBCadp.Fill(dt)
Me.DataGridView1.DataSource = dt
Label1.Text = CStr(Me.DataGridView1.RowCount)
End Sub
End Class
/code
getting unexpected error
ERROR [HY000] [Microsoft][ODBC Paradox-stuurprogramma] An unexpected error occurred in the driver for the remote database (11265).
Bert
now i want to convert my program to VB.
In Delphi it is simpel to connect to a database.
In VB i can not get this right.
What am i doing wrong:
code:
Public Class klant
Private Sub klant_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim odbcverbinding As OdbcConnection
Dim prdxconnString As String = "Driver={Microsoft Paradox Driver (*.db )};DriverID=538;Fil=Paradox 5.X;DefaultDir=E:\nog uit pakken\projecten\;Dbq=E:\nog uit pakken\projecten\;CollatingSequence=ASCII"
odbcverbinding = New Odbc.OdbcConnection(prdxconnString)
odbcverbinding.Open()
Dim str As String
str = "select * from test"
Dim ODBCadp As New OdbcDataAdapter(str, odbcverbinding)
Dim dt As New DataTable("test")
ODBCadp.Fill(dt)
Me.DataGridView1.DataSource = dt
Label1.Text = CStr(Me.DataGridView1.RowCount)
End Sub
End Class
/code
getting unexpected error
ERROR [HY000] [Microsoft][ODBC Paradox-stuurprogramma] An unexpected error occurred in the driver for the remote database (11265).
Bert