|
Hi there,
I'm trying to use ADO in my app. Here is an example query:
SELECT [Translation] FROM TRANSLATED_OTHER WHERE [Language] = 'Chinese' AND Text = 'Length';
If I call Fields::GetItem("Translation") on my RecordSet I get back the correct value. However if I use Fields::GetItem(0) a _com_error is thrown and I get the following error:
Item cannot be found in the collection corresponding to the requested name or ordinal.
What am I missing?
Thank you.
|
|
|
|
|
I don't quite remember but it may be that Item index in Recordset starts from 1 instead of 0.
Try using Fields::GetItem(1) instead.
Edbert
Edbert P.
Sydney, Australia.
|
|
|
|
|
Thank you for the suggestion, unfortuantely I already tried that to no avail.
|
|
|
|
|
Carlos Antollini posted a nice aricle with a wrapper class for ADO
here[^]. His wrapper method for Fields.GetItem(int index) worked well for me. Perhaps inspecting his code would answer your question.
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
Thanks, I'll take a look at it.
|
|
|
|
|
I've got rather a lot of cleaned data that has the title,first and last names stored as a single string in one column - is there a simplish way to split this out into 3 columns. e.g something like this ?
select splitTitle(name) as title, splitFirst(name) as first, splitLast(name) as last from myTable
Also what books do people recommend for learning this kind of stuff ?
Many thanks for any help
|
|
|
|
|
Hi Jerry,
You can split the values using substring and charindex in SQL Server. I guess, you have to write a stored procedure to split them based on delimiter by passing concatinated string and delimiter and get title, first and last names. I can help you in this, if you try out something..
Thanks,
Srinivas
|
|
|
|
|
Anyone know of a free/cheap tool that will connect to SQL server and output a simple report showing the tables and columns (including name, type, size and description)? Choosing the tables would be nice, as would the ability to list indexes.
cheers,
Chris Maunder
|
|
|
|
|
|
Looks good! Can't wait for the full article
cheers,
Chris Maunder
|
|
|
|
|
|
Sweet!!
So hold onto that 5 I just voted you, and when the article's done you can transfer it over to the full article
This is really awesome Colin. Thanks
cheers,
Chris Maunder
|
|
|
|
|
How I can rename SQL server name in a machine?
thanks.
|
|
|
|
|
|
|
I have an application which reads large CSV files and displays them in a DataGrid.
I have many methods for updating the DataTable EG Add/Delete/Rename/Fill Columns along with Math Functions EG Divide/Multiply ETC.
The question I have is where should the logic reside for updating the table? What object/s or class/es should be responsible for performing the upadte?
At the moment, I have several forms for displaying the options associated with the relevant functions and pass the DataTable to peform the update but this is getting messy.
I want to re-structure the application before it gets to big and at the same time seperate the data from the interface so the data source becomes transparent to the front end.
Is this possible and what is the best approach?
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
LearnVisualStudio.Net
|
|
|
|
|
I want to put a phonebook style database into my VC6 application, what is the best way to do that?
|
|
|
|
|
|
I was reading up on it and found a few ways it can be done...OLE DB, DAO, ADO.net, etc. Which is the best one to use to communicate with the data source or is there something else? Would an MS-Access data source be the best approach or does it even matter what kind of data source you have?
|
|
|
|
|
Hi
We have a client who runs a legacy 4GL system, with a C-ISAM backend (I think it is Informix).
The system is hosted ona linux box within the network
Now the developer of this system provides a READ-ONLY ODBC driver! But we have to manipulate data in this database, but I cannot find any drivers that I can use to talk to this system, and the developers have been less than helpful to say the least!
Any help would be greatly appreciated!
Thanks in advance!
|
|
|
|
|
If it's really C-ISAM, then it is informix. I'm pretty sure that you should be able to find (i.e. buy) ODBC drivers for the system. I did some work a while ago (OMG! over 3 years) doing just this kind of thing.
The alternative, which is almost too ugly to contemplate, would be to write a linux server process that uses C-ISAM directly, and have that do your manipulation, via something like normal sockets.
A third alternative is to have the linux box expose the raw data files via SAMBA, and use something like Byte Designs' D-ISAM product.
Steve S
Developer for hire hired!
|
|
|
|
|
Hi
I have to select the distinct last three inserted records.
I have given the query is not working.
select top 3 distinct categoryname,groupname from group order by createddate desc;
can anyone help.
Thanks & Appreciating your help.
|
|
|
|
|
First of all, if you table name is 'group' then you table name is a reserved word so you will need to wrap it in brackets, [group]. You will also need to include the createdate in the select query since the query is really a group by query with the distinct.
Give the following query a try.
select distinct top 3 categoryname, groupname, createdate from [group] order by CreateDate desc; Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
|
|
|
|
|
What is this error due to?
Error Type:
Provider (0x80030103)
Can't save.
<br />
set cn =Server.CreateObject("ADODB.Connection")<br />
cn.open "Provider=SQLOLEDB.1;Integrated Security=SSPI; Persist Security Info=False;Initial Catalog=pubs;Data Source=XPHTEK"<br />
set RS=Server.CreateObject("ADODB.RECORDSET")<br />
RS.Open "Select au_fname, phone, city from authors",cn<br />
RS.Save "C:\pubauthrs.xml",adPersistXML<br />
RS.Close<br />
cn.close<br />
----------
Both ADO 2.5 and 2,6 referenced.
IDE is Visual Studio 6.0
IIS 5.0
|
|
|
|
|
Been a while since I have coding any ADO but at first glance I would say close the connection. Recode the above using disconnected recordsets and then try saving the recordset.
set cn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.RECORDSET")
cn.open "Provider=SQLOLEDB.1;Integrated Security=SSPI; Persist Security Info=False;Initial Catalog=pubs;Data Source=XPHTEK"
rs.CursorLocation = adUseClient
rs.Open "Select au_fname, phone, city from authors", CN, adOpenDynamic, adLockBatchOptimistic, adCmdText
rs.ActiveConnection = Nothing
rs.Save "C:\pubauthrs.xml",adPersistXML
rs.Close
This was not tested but should work.
Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
|
|
|
|