Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Transfer ADO Code to ADO.NET

Reply
Thread Tools

Transfer ADO Code to ADO.NET

 
 
ronaldlee
Guest
Posts: n/a
 
      12-17-2004
HI,
how to do a RecordSet in OleDbConnection???
my original code is using ADODB.RecordSet
But how can i do the RecordSet in OleDbConnection?

my original code

Function openDB() As Object
objConn = New ADODB.Connection
objConn.Open(dbDNS) '("dbfile")

objRS = New ADODB.Recordset

End Function


Function closeDB() As Object
' If the RecordSet has a state of 1 (open) close it
If objRS.state = 1 Then
objRS.Close()
End If

objConn.Close()
objConn = Nothing
End Function

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      12-17-2004
This is really a bad way to do database operations in ASP.Net. Interop is
problematic, and there are plenty of classes in the CLR for working with
databases. I would suggest using them.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"ronaldlee" <> wrote in message
news:41c2f45c$...
> HI,
> how to do a RecordSet in OleDbConnection???
> my original code is using ADODB.RecordSet
> But how can i do the RecordSet in OleDbConnection?
>
> my original code
>
> Function openDB() As Object
> objConn = New ADODB.Connection
> objConn.Open(dbDNS) '("dbfile")
>
> objRS = New ADODB.Recordset
>
> End Function
>
>
> Function closeDB() As Object
> ' If the RecordSet has a state of 1 (open) close it
> If objRS.state = 1 Then
> objRS.Close()
> End If
>
> objConn.Close()
> objConn = Nothing
> End Function
>
> *-----------------------*
> Posted at:
> www.GroupSrv.com
> *-----------------------*



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call transfer full consult is not working properly, blind transfer isworking instead alexsaiz82 Cisco 1 10-09-2008 12:08 AM
Translating Oracle Package Call from ADO to ADO.Net dmiratsky@yahoo.com ASP .Net 0 02-14-2005 10:39 PM
Accessing an ADO Recordset or Record from ADO.NET nita ASP .Net 1 11-20-2004 07:06 AM
006~ASP 0230~Server.Transfer Error~The call to Server.Transfer failed while load Jim ASP General 1 01-28-2004 06:37 PM
Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. Navin ASP General 1 09-09-2003 07:16 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57