473,385 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ADODB.Recordset Source

I am upgrading an application from VB6 to .NET.
One of the forms, which synchronizes data across a network, did not
upgrade, so I copied the code and worked it out manually.

I am now having a problem with the following lines:

RS.Source = strSQL
RS.Open()

The program seems to avoid this code for a bit, then throws an error.
I also tried just: RS.Open(strSQL)
but that threw a different error... is there a better way to set the
source, which is a SQL string?

Jun 8 '07 #1
5 4413

"gsauns" <gs****@gmail.comwrote in message
news:11**********************@e65g2000hsc.googlegr oups.com...
>I am upgrading an application from VB6 to .NET.
One of the forms, which synchronizes data across a network, did not
upgrade, so I copied the code and worked it out manually.

I am now having a problem with the following lines:

RS.Source = strSQL
RS.Open()

The program seems to avoid this code for a bit, then throws an error.
I also tried just: RS.Open(strSQL)
but that threw a different error... is there a better way to set the
source, which is a SQL string?
http://www.startvbdotnet.com/ado/sqlserver.aspx

You can use dr.("SqlField name") instead of ordinal position numbers, look
it up use Google.

Also you may have to use the Convert statement as well to set Variable type
from database field type.

You should go get yourself a good ADO.net book.


Jun 8 '07 #2
gsauns wrote:
The program seems to avoid this code for a bit, then throws an error.
I also tried just: RS.Open(strSQL)
but that threw a different error...
What are the errors?

--

(O)enone
Jun 9 '07 #3
Thanks guys... I will try those suggestions today. Yes, you're
absolutely right- never mind the fact this is my first foray into
database programming, period- any suggestions on a book?

Errors are:
3265- Item cannot be found in the collection corresponding to the
requested name or ordinal
or, more commonly:
5- Procedure call or argument is not valid.
Jun 9 '07 #4
My SQL command is legit... the problem is that I am not trying to READ
from a database. That part of my app works fine. It is when I am
trying to WRITE to the DB. It is trying to send from a local Access
database to a SQL Server 2005 database on a server.

The strange part is that the errors usually happen on the 2nd or 3rd
records the app tries to sync... it seems like the code simply skips
the two lines (RS.Source=strSQL; RS.Open()) the first 2 or 3 times
through before throwing the error.

The code builds the SQL string off of the source recordset (which is
from the local Access DB), and then goes for the insert on the
destination recordset (on the server). Both recordsets are passed to
the function by value. As I said, the SQL string is OK; all fields and
their types match up.

Jun 9 '07 #5
gsauns wrote:
Thanks guys... I will try those suggestions today. Yes, you're
absolutely right- never mind the fact this is my first foray into
database programming, period- any suggestions on a book?

Errors are:
3265- Item cannot be found in the collection corresponding to the
requested name or ordinal
or, more commonly:
5- Procedure call or argument is not valid.

If that's on the update part you're talking about in your following
post, then a field name in the recordset does not match the field name
on the table in the database or it's not there in the table, period.
Jun 9 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: elcc1958 | last post by:
I need to support a VB6 application that will be receiving disconnected ADODB.Recordset from out DotNet solution. Our dotnet solution deals with System.Data.DataTable. I need to populate a...
0
by: Channing Jones | last post by:
Hello everyone, I am trying to store data in a binary field of an SQL-Server table using ADODB. So far, I have managed to store a record but not any data in the binary field. I only get...
0
by: CFW | last post by:
I thought this was going to be easy but I'm missing something . . . I need to open an ADODB recordset using the recordset source for a list box on my for. When my form opens, the list box ADODB...
3
by: | last post by:
Hello ppl, I have snippet that works fine udner ADODB with VB6, but something wrong with it in Vb.NET. Anyone can help? Recordset1 (ADODB.Recordset) Error: Arguments are of the wrong type, are...
3
by: Yuk Tang | last post by:
I'm trying to grab the fieldnames and values from a recordset, but I'm getting errors. I have an idea what the error might come from, but I'm not sure how to correct it. I'm connecting to an...
7
by: boyleyc | last post by:
Hi all I have written a database in access and used ADODB recordsets all the way through. The only recordsets that are not ADODB are the listbox navigation code automatically generated by access...
6
by: Oko | last post by:
I'm currently developing an MS Access Data Project (.adp) in MS Access 2002. One of the reports within the DB uses data that is Dynamic and cannot be stored on the SQL Server. To resolve this, I...
2
bmallett
by: bmallett | last post by:
I am getting the following error: Error Type: ADODB.Command (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another....
1
by: Mr. X. | last post by:
Hello. If ADO.NET is better choice for modern programming, so I shall use it. There is also application-box - is it related to ADO.NET. What classic thing to do is : using adodb.connection,...
2
EYE4U
by: EYE4U | last post by:
Hi all, This is how you can connect to an Access Database using ADODB.. First add a reference to Microsoft ActiveX Data Objects 2.0 Library Now to lets Declare some variables : Private Con...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.