|
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
|
|
|
|
|
I have a C# application for generic database access that does all sorts of extra processing. It is a port of an existing COM application written in C++.
The application uses objects from Microsoft.Data.Odbc namespace.
So I'm opening an OdbcConnection
and using an OdbcDataApaptor for retrievals, and an OdbcCommand for executing updates using ExecuteNonQuery.
All is working fine except for one thing involving the SQL Server RaiseError command being executed in a trigger.
The code I'm using in the application for update commands is this:
public long ExecuteChangeQuery(string sSQL)
{
long lResult;
try
{
m_cmd.CommandText = sSQL;
lResult = m_cmd.ExecuteNonQuery();
}
catch(OdbcException e)
{
// log the exception
throw e;
}
return lResult;
}
Under normal circumstances everything is fine. And if a normal error occurs, such as a SQL syntax error, etc. the exception is caught as expected.
However when the SQL server trigger calls RaiseError with a severity level of 16, which should throw an exception. Nothing happens. No exception is thrown and the call to ExecuteNonQuery simply returns -1 to indicate that a rollback occurred.
The existing COM application works properly with the same trigger.
Any ideas as to what's going wrong, or what I'm not doing?
Help greatly appreciated.
|
|
|
|
|
I have a VB 6 Application that writes to a ms access DB. My connection works fine ( using ADO) problem is I'm trying to do a search on the table using a varible. the varible is string. I'm not sure if i have the syntax correct. PLEASE HELP
Here is the code
Private Sub CmdSearch_Click()<br />
Dim strSearch As String<br />
<br />
strSearch = lblSearch.Caption<br />
<br />
adoRecords.RecordSource = "SELECT * from Volenteers where In [last_name] Like strSearch ; "<br />
<br />
adoRecords.Refresh<br />
<br />
End Sub
I get a error of syntax error in FROM clause
strSearch is from a text box from a dialog form
i had the same set up in a different program almost same sytax, and it works there I'm lost
any help would be appreciated
thanks
|
|
|
|
|
Hm - I would have written it as:
for exact matches -
"Select * from Volunteers Where [Last_Name] = '" & strSearch & "'"
for wild cards -
"Select * from Volunteers Where [Last_Name] Like '" & strSearch & "%'"
I believe this will work with access, try the query builder tool.
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|