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