vb6 to vb.net database question 
Author Message
 vb6 to vb.net database question

I have a simple VB.NET question
I upgraded this simple testform to VB.NET
there are no compile errors but when i click on the command button the
program hangs with a com error
it hangs when it reaches this line  rs.Open()
anybody has any ideas
TIA

************************************************VB6*************************
********************

Private Sub Command3_Click()

Dim cn As New ADODB.Connection, rs As New ADODB.Recordset

Const DBPATH = "D:\Parma\Parma.mdb;Persist Security Info=False"

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPATH
Set rs.ActiveConnection = cn
rs.Source = "Select * from workers where ID = 1"
rs.Open
txtLastName.Text = rs("LastName")
txtFirstName.Text = rs("FirstName")
rs.Close
cn.Close
Set cn = Nothing
Set rs = Nothing

End Sub

************************************************VB.NET**********************
***********************

 Private Sub Command3_Click(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArgs)

            Dim cn As ADODB.Connection = New ADODB.Connection()
            Dim rs As ADODB.Recordset = New ADODB.Recordset()

            Const DBPATH As String = "D:\Parma\Parma.mdb;Persist Security
Info=False"

            cn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
DBPATH)
            rs.ActiveConnection = cn
            rs.Source = "Select * from workers where ID = 1"
            rs.Open()
            txtLastName.Text = rs.Fields("LastName").Value
            txtFirstName.Text = rs.Fields("FirstName").Value
            rs.Close()
            cn.Close()
            cn = Nothing
            rs = Nothing

        End Sub



Sat, 24 May 2003 03:00:00 GMT  
 vb6 to vb.net database question
yes,
it's beta the readme says that only the demo's are 'sort of ' garantueed to
work.

--

Nierop Webconsultancy
Check the new ASP Session replacer for webfarms at
http://www.nieropwebconsult.nl/asp_session_manager.htm

+31 6 50 287 251
The Netherlands, Amsterdam

Quote:
> I have a simple VB.NET question
> I upgraded this simple testform to VB.NET
> there are no compile errors but when i click on the command button the



Sat, 24 May 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VB6 to VB.Net conversion question

2. VB6->VB.NET questions

3. vb6 to vb.NET Question (ADO)

4. Upgrade question re: VB6 to VB.Net

5. VB.NET vs. VB6 royalties questions

6. vb6 to VB.NET question

7. Access Database Grid in Vb.net, questions????

8. Question About the VB.Net with Database Access

9. VB.NET / Database question

10. Crystal Reports 8.5 (VB6) to Crystal Reports NET (VB.NET) conversion

11. Converting VB6 to VB.NET without a full VB6 project

12. Database On Net in VB.NET

 

 
Powered by phpBB® Forum Software