bert aalders
Member
- Joined
- Mar 4, 2011
- Messages
- 16
- Programming Experience
- Beginner
if i run this program in a form it works fine.
If i put the programming in a module because i want the standard parts in a module it shows nothing.
What am i forgetting?
Module procedures
Public odbcverbinding As Odbc.OdbcConnection
Public Sub klant_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim prdxconnString As String = "Driver={Microsoft Paradox Driver (*.db )};" & _
"DriverID=538;Fil=Paradox 7.X;DefaultDir=E:\nog uit pakken\projecten\VB 2010\toolbox\toolbox_bert\toolbox\database;" & _
"Dbq=E:\nog uit pakken\projecten\VB 2010\toolbox\toolbox_bert\toolbox\database\;CollatingSequence=ASCII;"
odbcverbinding = New Odbc.OdbcConnection(prdxconnString)
odbcverbinding.Open()
Dim str As String
str = "select * from alliancehulp"
Dim odbcadp As New Odbc.OdbcDataAdapter(str, odbcverbinding)
Dim dt As New DataTable("alliancehulp")
Me.DataGridView1.DataSource = dt
odbcadp.SelectCommand.Connection = odbcverbinding
odbcadp.Fill(dt)
odbcverbinding.Close()
End Sub
End module
Bert
If i put the programming in a module because i want the standard parts in a module it shows nothing.
What am i forgetting?
Module procedures
Public odbcverbinding As Odbc.OdbcConnection
Public Sub klant_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim prdxconnString As String = "Driver={Microsoft Paradox Driver (*.db )};" & _
"DriverID=538;Fil=Paradox 7.X;DefaultDir=E:\nog uit pakken\projecten\VB 2010\toolbox\toolbox_bert\toolbox\database;" & _
"Dbq=E:\nog uit pakken\projecten\VB 2010\toolbox\toolbox_bert\toolbox\database\;CollatingSequence=ASCII;"
odbcverbinding = New Odbc.OdbcConnection(prdxconnString)
odbcverbinding.Open()
Dim str As String
str = "select * from alliancehulp"
Dim odbcadp As New Odbc.OdbcDataAdapter(str, odbcverbinding)
Dim dt As New DataTable("alliancehulp")
Me.DataGridView1.DataSource = dt
odbcadp.SelectCommand.Connection = odbcverbinding
odbcadp.Fill(dt)
odbcverbinding.Close()
End Sub
End module
Bert