|
|
|
hi
I have a class(eg CMyClass) with a data member which is a _RecordsetPtr ,bind with a table of ORACLE which has a CLOB field.
class CMyClass
{
_RecordsetPtr m_pRst;
public:
void SomeMethod(CString strContent)
{
IDBAccessPtr o(__uuidof(DBAccess));
m_pRst = o.GetRecordset(_T("select * from tbl_a where id = 0"));//select an empty recordset
m_pRst->AddNew();
m_pRst->PutCollect(_T("id"),lDataId);
m_pRst->PutCollect(_T("content"),(LPTSTR)(LPCTSTR)strContent);
o.UpdateRecordset(m_pRst);
}
};
structure of tbl_a is:
create table tbl_a
(
id number(10,0),
content clob
)
/
using of CMyClass:
void UseOfMyClass(CString str)
{
CMyClass obj;
obj.SomeMethod(str);
}
First call UseOfMyClass with a very long string as parameter,is ok.
then call UseOfMyClass again(and all the succeeding calling ),the system issue a messagebox say:
""在对应所需名称或序数的集合中,未找到项目。
0x800a0cc1"
means "Item cannot be found in the collection corresponding to the requested name or ordinal"
if first calling of UseofMyClass with a shorter string parameter and the second call to UseofMyClass does not issue error and the result is correct.
I don't know why ,is there a stack overflow in _Recordset Object after handle a very long string ?
Help me please!
thanks advaced.
|
|
|
|
|
It seams that the stack of the app has been destroyed,because when then app exit if it execute the First call UseOfMyClass with a very long string as parameter,the system issue:
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!
Program: E:\mytest.exe
File: dbgheap.c
Line: 1044
Expression: _CrtIsValidHeapPointer(pUserData)
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
---------------------------
终止(A) 重试(R) 忽略(I)
---------------------------
unless it's ok.
|
|
|
|
|
Running SQL, and building a searchable datagrid. A how to from microsoft, Article number 308070 (Q308070). I keep getting a break at my fill line. I rewrote this code three times, same error. I have a funny feeling the code is wronf in the article, can someone take a peek, and see if it seems right? Thanks!
http://support.microsoft.com/default.aspx?scid=kb;en-us;308070
|
|
|
|
|
i have a single table in northwind data base its contain a one row and two columns UserName ,Pass...when i made change to the pass...i found exption
invalid operation...and here is the in c#
ds.Tables["Test"].Rows[0]["Pass"]="dodo";
sqlConnection1.Open();
cmdB=new SqlCommandBuilder(ad);
ad.Update(ds);
sqlConnection1.Close();
hi i am ezak neno
|
|
|
|
|
The SqlCommandBuilder is a black box (stuff goes in. Something happens. Stuff comes out. What happens? Who knows?) - You should, IMO, learn how to construct your own update statements. That way you will know what you've written and if anything goes wrong you will have more chance of tracking it, and understanding why it went wrong.
From MSDN: Weaning developers from the CommandBuilder[^]
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
I have a table in sqlServer with some columns if dateTime values (date + time)
I wrote a stored procedure that select those columns, the stored Procedure works properly.
I tried to retrieve the data into dataSet and then to dataGrid. I get a very nice datagrid with the whole data, but the coulumns of datatime values show only the date. I need the time also.
How can I get it?
I know that there is some types of datacolumn like dataGridBoolColumn or dataGridTextBox column, but I couldn't find dataGridDateTimeColumn.
Thank you;)
|
|
|
|
|
Use the DataFormattingExpression property. When you get your grid's properties, select your column and you should see an option. For example, you can use expressions like {0 }, {0:f}, and so on. A full list can be found: http://www.stevex.org/dottext/articles/158.aspx[^]
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
|
Hi all
I wonder if it is possible to get information about a specific SQL Server database? What I need is a way to get a list of all the tables in the database and also the names of all columns in all tables. I also need a way to get the datatype of each column.
Is this possible in SQL Server? (I am using MSDE)
|
|
|
|
|
Yes - the system tables (e.g. Sysobjects) hold details of the tables, views etc. and you can get the SQL of stored procedures and views from syscomments
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
SQL DMO is a great library for getting Sql Server metadata. See: http://www.sqlteam.com/item.asp?ItemID=9093[^].
It gives you a bit more flexibility than running queries like "select * from sysobjects where type='u'" and so on. It gives you a navigable heirarchy as well. You can get schema info using the .NET framework, but for what you're describing, I'd use DMO.
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
True - but since most enterprise class database platforms have their own versions of the system tables you can wrte a plug-in based system that could be platform independent - rather like the Database Build Wizard[^]
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Hi Everyone
Im a Beginner in using DTS
i want to make a package in SQL Server That execute an sql query:
- If this query returns rows, i want to take the first field for every row
and give it to a second job that execute another query using this field in a
loop until the number of fields ends
- And if this query doesent return any rows, i want to skip the others steps
that follow it
How Can I Do It????????
|
|
|
|
|
Hi Maro,
I came across an article today that might help you get started.
http://www.sqlteam.com/item.asp?ItemID=6881
The article was actually about trapping errors, but there are a couple of lines that may point you in the right direction:
Basically, try this:
declare @RC int
set @rc = 0
select Column1 from Table1
select @RC = @@ROWCOUNT
if @RC > 0
begin
{do the second job}
end
I realize this doesn't solve your entire problem, but I hope it at least points you in the right direction.
-DPR
|
|
|
|
|
I'm tryingt o use this statement
Adodc.RecordSource = "UPDATE Volenteers SET (Time_In) = '0' "<br />
Adodc.RecordSource = "UPDATE Volenteers SET (Time_Out)= '0' "
It worked once!!! now after i write some rwecords to te table, and try to clear those specific fields, thet don't clear, any ideas??
VB6 front end w/ MS access 2k DB
|
|
|
|
|
I'm just taking a stab here but why are you assigning a recordsource property when in actuality you're executing a sql action statement? If you're using VB6 and ADO, you can use the connection object's 'execute' method to execute a sql statement, after which you can refresh your recordsource.
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
I have an application the adds records to an MS Access database. When the DataAdaptor.update command is issued I get a Syntax error in insert into statement. I am using command builder and only get the error on one table. That table has two fields which are the problem. They are called "Password" and "Usergroup." If I rename the fields it works without any problem. So why not just rename them? Simple right. No, the database is used by another application and chances of getting it changed is slim at best.
Any ideas as to how to work around this?
Any help would be greatly appreciated.
Mike
|
|
|
|
|
|
Password is a reserved word Can't use it
|
|
|
|
|
Then how is it used by the other application?
I don't use Access but, maybe it permits escaping of column names with square brackets. e.g. [Password]
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
I have a access table and want to export the data in the table to a html file every night. i also need to clear 2 fields in the table after the data has been exported. Any ideas on how to do this?
I'm using ADO on the VB6 forms
|
|
|
|
|
Write a VBScript and use the Command scheduler.
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
Where I can get the subj? Thanks in advance
|
|
|
|