Friday, March 30, 2012
runtime error 3265: item cannot be found in this collection
I connected to sqlserver 7 db from vb6.I got one record displayed from my db table as rs.fields(0).If i give rs.fields(1) , it gives me the error, item cannot be found in this collection.When i dispalyed the record count as msgbox rs.recordcount it shows -1.what may be the error, pls help.
LydiaPlease provide your sql statement within vb - and which cursorlocation are you setting (client or server). It sounds like your sql statement is only returning 1 column. When you use rs.fields(1) accesses the 2nd column returned by your sql query - not the next record in the recordset.|||Hello!
Thank you very much, i fixed the error as soon as i written to you.That is the same thing that you replied.It's coz i am quite new to VB and am learning.
Two more issues - i need ur help
1. But still i am getting the record count as -1 . why is it? but i am getting all my records in the record set.
2. I created a function to fill up the list box as
Function FillList(Listitem as Listbox, FieldName as Field, TableName as Table)
--Code--Goes here
End Function
when i tried to call the function as
FillList(List1, m_email,members)
it is returning error as : ByVal ref argument type mismatch
how should i refer the values with the arguments in the function?
Pls help
Lydia|||Which cursorlocation are you using ?|||Originally posted by rnealejr
Which cursorlocation are you using ?
What do you mean by cursor location? i gave the code like this:
--some code here--
opened the record set as AdopenforwardOnly|||Both the connection and recordset objects contain a property called cursorlocation. If you are not setting it, go into debug and view the properties of the object and examine the cursorlocation property.|||Thank you very much, After setting the cursor location, i got the correct record count.|||Happy to help.|||I have a function to fill up list box with a DB Field values as
Public Function FillList(ListItem As ListBox, FieldName As Field,TableName as Table)
Dim i As Integer
i = 0
DbConnect
strSQL = "select FieldName from TableName"
'without using the connection object
ObjRs.Open strSQL, strConn
' Add Items in the list box
ObjRs.MoveFirst
Do While Not ObjRs.EOF
ListItem.AddItem ObjRs(0), i
ObjRs.MoveNext
i = i + 1
Loop
'Be sure you close and destroy your objects.
ObjRs.Close
ObjConn.Close
Set ObjConn = Nothing
Set ObjRs = Nothing
End Function
' Then i called the function as
call FillList(List1,"M_email","Members")
It gives me error as : Type Mismatch
What is the mistake in the code?|||Please post the code before the FillList. How are the Field and Table referenced ( like through adodb ...) ?|||Yes, I connected to the DB as ADODB.Connection|||How are you able to reference "Table" ? Also, you should be explicit in your declarations (Adodb.Field).
The problem is that you are trying to pass a string to a function expecting an object. Both the field/table should be strings - so you would build your sql statement like:
strSQL = "select " & FieldName & " from " & TableName
Runtime error 3146
I am currently using SQL 2000 and Access 97. My desktop
used to be Win NT. Recently i migrate to Win XP and I
got this error while SELECTING, UPDATING and INSERTING
record.
Full error is Runtime '3146'.ODBC call failed.
The documentation for this error is quite limited, anyone
can help? I need solutions? Does converting the Access
97 to Access 2002 help?
Thanks and Regards.The error is just generic. My first guess would be an MDAC
issue if by migrate you updated your desktop from NT to XP.
You can always reapply SQL Server SP 3a to make sure your
MDAC is up to date. You could also run the component checker
tool to check your MDAC installation. You can download the
tool, as well as MDAC versions from MDAC downloads at:
http://msdn.microsoft.com/data/mdac/default.aspx
-Sue
On Wed, 7 Jul 2004 01:23:52 -0700, "sam"
<anonymous@.discussions.microsoft.com> wrote:
>hello!
>I am currently using SQL 2000 and Access 97. My desktop
>used to be Win NT. Recently i migrate to Win XP and I
>got this error while SELECTING, UPDATING and INSERTING
>record.
>Full error is Runtime '3146'.ODBC call failed.
>The documentation for this error is quite limited, anyone
>can help? I need solutions? Does converting the Access
>97 to Access 2002 help?
>Thanks and Regards.|||hi!
I discover that when i do the same operation on SQL
Server 2000 Professional Edition, it works!
The error occurs when I did the operation in SQL Server
2000 Standard Edition.
Seems like this is the root cause, but cannot confirm.
What do you think?
By the way, how do i convert Standard Edition to
Professional Edition?
Thanks!
>--Original Message--
>The error is just generic. My first guess would be an
MDAC
>issue if by migrate you updated your desktop from NT to
XP.
>You can always reapply SQL Server SP 3a to make sure your
>MDAC is up to date. You could also run the component
checker
>tool to check your MDAC installation. You can download
the
>tool, as well as MDAC versions from MDAC downloads at:
>http://msdn.microsoft.com/data/mdac/default.aspx
>-Sue
>On Wed, 7 Jul 2004 01:23:52 -0700, "sam"
><anonymous@.discussions.microsoft.com> wrote:
>
anyone[vbcol=seagreen]
Access[vbcol=seagreen]
>.
>sql
Runtime error 3146
I am currently using SQL 2000 and Access 97. My desktop
used to be Win NT. Recently i migrate to Win XP and I
got this error while SELECTING, UPDATING and INSERTING
record.
Full error is Runtime '3146'.ODBC call failed.
The documentation for this error is quite limited, anyone
can help? I need solutions? Does converting the Access
97 to Access 2002 help?
Thanks and Regards.
The error is just generic. My first guess would be an MDAC
issue if by migrate you updated your desktop from NT to XP.
You can always reapply SQL Server SP 3a to make sure your
MDAC is up to date. You could also run the component checker
tool to check your MDAC installation. You can download the
tool, as well as MDAC versions from MDAC downloads at:
http://msdn.microsoft.com/data/mdac/default.aspx
-Sue
On Wed, 7 Jul 2004 01:23:52 -0700, "sam"
<anonymous@.discussions.microsoft.com> wrote:
>hello!
>I am currently using SQL 2000 and Access 97. My desktop
>used to be Win NT. Recently i migrate to Win XP and I
>got this error while SELECTING, UPDATING and INSERTING
>record.
>Full error is Runtime '3146'.ODBC call failed.
>The documentation for this error is quite limited, anyone
>can help? I need solutions? Does converting the Access
>97 to Access 2002 help?
>Thanks and Regards.
|||hi!
I discover that when i do the same operation on SQL
Server 2000 Professional Edition, it works!
The error occurs when I did the operation in SQL Server
2000 Standard Edition.
Seems like this is the root cause, but cannot confirm.
What do you think?
By the way, how do i convert Standard Edition to
Professional Edition?
Thanks!
>--Original Message--
>The error is just generic. My first guess would be an
MDAC
>issue if by migrate you updated your desktop from NT to
XP.
>You can always reapply SQL Server SP 3a to make sure your
>MDAC is up to date. You could also run the component
checker
>tool to check your MDAC installation. You can download
the[vbcol=seagreen]
>tool, as well as MDAC versions from MDAC downloads at:
>http://msdn.microsoft.com/data/mdac/default.aspx
>-Sue
>On Wed, 7 Jul 2004 01:23:52 -0700, "sam"
><anonymous@.discussions.microsoft.com> wrote:
anyone[vbcol=seagreen]
Access
>.
>
Runtime data source error
I have a defined data source to an oracle server. I've alredy intalled oracle client, and setup my data source to save the user and password. I'm using .NET provider/OracleClient DataProvider Connection. When I click on "Test Connection" Button, SSIS reports SUCCESS. In Connection Manager TAB I created on connection called "OracleServer" from my oracle data source, described above.
In my package, I defined a DataReaderSource task, I specified "OracleServer" as a connection to it. I can preview data and view oracle's columns name..., so it make me think that everything is fine. But when It execute the task it FAIL and notify logon error and that password can't be blank.
Please help, I need read from the oracle server!!
Thank you.
This may depend on the connection manager, the provider and your ProtectionLevel in the package. Check these.
One of them means you loose the password. If you don't know, between you clicking Execute in the designer and the package running, it is saved, and loaded into a separate execution host. The host then runs the package and passes back the debug messages to BIDS/VS to update the UI with pretty colours for you. So even though the password is there in your current BIDS/VS session, it is probably being lost on the save, prior to being loaded into the execution host. If you close the package in BIDS, and re-open do you still have the password? I would guess not, and this is the issue you see when trying to execute it.
You can play with the various settings, but my favoured approach is to set the package ProtectionLevel to DontSaveSensitive. This means no passwords are ever saved, but you then use a Configuration to set them. Going forward every time the package is loaded, by an execution host or the designer or other tool, it will read the configuration and apply the password or any other configuration you may have set. Problem solved! it may seem like hard work, but if you plan on deploying packages this is really got to be good practise.
|||Hello,
When I close BIDS and reopen it, I can still see the password. However let me tell you that I already find the solution.
The problem was that my oracle server is 10.1.x and my oracle's drivers installed on SQL Server machine was 10.2.x. Only I unistalled these drivers and install 10.1 version and everything works!.
thanks for your advices.
Hernan.