reverting from 2005 to 2003

shomoodro

Member
Joined
Aug 25, 2005
Messages
14
Programming Experience
Beginner
Hi
I started using VB with Visual studio 2005 beta. I have done my work and it is completed. At the end, we got some problem (more space required for .net framework) with the device in which we have to install the software, so I started to revert to 2003.

While using 2005, I used recordset to access database with a particular query string. It is so easy in 2005. Now I want to do the same in 2003, but stuck with it. This is how I used my code in 2005 -

Dim rset as new ADODB.Recordset
Dim query as new String("")
Dim connection As New ADODB.Connection

query="Select * From item" 'item is the name of a table
connection.ConnectionString = "whatever"
connection.Open()

rset.open(query,connection,, ADODB.CursorTypeEnum.adOpenStatic,ADODB.LockTypeEnum.adLockOptimistic)

'now I can access any value and modify the value in any column using the following.
rset.Fields("itemID").Value=12
itemID = rset.Fields("itemID").Value

So now I want to access the DB in the same way I did with 2005 if possible. I already tried. In 2005 it is -

rset.open(String, Connection, CursorType, LockType)

But in 2003 I found it is -
rset.open(Source, connection, CursorType, LockType)

I don't really know about the 'Source' and how to attach a SQL query as I did with 2005.

Please help me. Thank you in advance.

shomoodro
 
Why I get this error?

How to solve the following error. It occurs when I try to open connection.

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in project2.exe

Additional information: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Thank you in advance

shomoodro
 
I don't know why you would have used ADO with VB.NET 2005. No new code should be written using ADO unless it is for compatibility with existing VB6 code. All new code should be written using ADO.NET, whether 2002, 2003, or 2005.
 
Man, I swear, if I see another poster try to use ADODB in .NET instead of ADO.NET, I'm going to toss myself under the next bus that goes by.

Look at my sig & check out the ADO.NET article.

-tg
 
jmcilhinney said:
From my experience, we'll be mourning your loss very soon tg. :(
Saddly enough.... I agree completely..... sad realy.....

-tg
 
Back
Top