vb6 to VB.NET question 
Author Message
 vb6 to VB.NET 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 comman 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 question
Denis,

Recommend you move to the VB.Net newsgroups Microsoft has up.  Most likely
you will get a much faster answer to your .Net question there than you will
here.

--
Sincerely,

Todd B - Agendum Software

(608) 837-6736   Voice                         (419) 821-9599 Fax

Upcoming new release!  AgMapthat - Project Browser Plus!    Setup your
treeview display with favorites, encrypt your source, enable full group
project
task management and more!   Visit our web site today for more information
and screenshots on this soon to be released major VB enhancement tool!


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 comman button the
> program hangs with a com error
> it hangs when it reaches this line  rs.Open()
> anybody has any ideas
> TIA


************************************************VB6*************************
Quote:
> ********************

> 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**********************

- Show quoted text -

Quote:
> ***********************

>  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  
 
 [ 2 post ] 

 Relevant Pages 

1. VB6->VB.NET questions

2. vb6 to vb.NET Question (ADO)

3. VB6 to VB.Net conversion question

4. Upgrade question re: VB6 to VB.Net

5. VB.NET vs. VB6 royalties questions

6. vb6 to vb.net database question

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

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

9. vb.net / ado.net design question

10. Newbie question (ado.net / vb.net)

11. Date problems with XML in ASP.NET / VB.NET- newbie question

12. VB.NET system.net.sockets question

 

 
Powered by phpBB® Forum Software