Here is what I did, and interestingly enough...it works.
I created code that essentially does nothing but execute a loop and pass a counter to a control. Then I added a control to the form, left it visible, but essentially hid it from the form by making the textbox's background color, border color, and fore color the exact same as the underlying form color. This provided something for the processor to do while the QueryDef was being created. I essentially needed to count to 10000.
Here is the code:
'Provides time to create QueryDef qryFinalResult
Dim intCount As Integer
intCount = 0
For intCount = 1 To 10000
txtCounter.Text = "Count: " & intCount & "."
intCount = intCount + 1
Does anybody have a more elegant way to do this? This code prevents that error message from coming up indicating that the QueryDef that I had just created does not exist. When I step through the code myself, the processor has enough time to create the QueryDef object, but when I run it as an application, it does not have time to create it in time to use it.
I created a function to check if a table exists, as I need to check for this sort of thing frequently.
Here is the function code:
CREATE function dbo.DoesObjectExist(@Name varchar(200), @Type char(1))
declare @Result varchar(7)
if exists (select * from sysobjects
where name = @Name
and xtype = @Type)
select @Result = 'present'elseselect @Result = ''return @Result
This is how you check if the OffVansQtyOrdered table exists using this function:
if dbo.DoesObjectExist('OffVansQtyOrdered','u') = 'present'
firstly thanks again,
by the way,i am so sorry, that i do not really understand what you write above, and i do not know in VC++ , how to create a table, just like the question i write "a problem about m_pConnection->Execute", have you a good way to resolve it, or can can you tell me which problem exist in my program
The first example is what is called a "user defined function".
This is a means for SQL to process data based on parameters passed to the function and then return a value(or a table).
In this case the function takes an object and object type as input.
The object type, in the bottom piece of code, is "u" which means that the function only looks for tables.
The advantage of a function is that you can create this code once and reuse it many times by just calling it with dbo.DoesObjectExist('tablename','u').
In terms of creating a SQL table in C++ I'm sorry to say that I cannot help you with that yet as I am learning C# at the moment.
What I can recommend is google and searches with strings such as "create SQL table with C++" and "SQL create table".
As a tool google is invaluable and has proved to be just this in my work - as there is always going to be an example somewhere out there of what you are trying to do.
hi every body
i have my project that i have pages that contains grid views then with updating sume page the underlining under page number became hidden and some pages still underline under page number visible what happend and how i can make the pages page underlines visible thx in advance.
if i m getting you correct so let me tell you there is no such way by which u can get the last row of the tabe u shuld be more specific abut ur query..but there is a way by which u can achieve ur task.
If you need to extract data in a particular order, the data itself should provide the means of doing this. For instance, if you had an numeric EmployeeID field which was incremented every time a new employee joined the company then you could find the last value in your table by selecting the row of data with the highest EmployeeID value. You don't have any data items that you can use for this purpose in your table so you can't achieve this.
Suppose if i have 4 After triggers and i want to give the order for them in which they fired i can do that with the help of sp_setordertrigger but with this i can only specify which one can be fired first and last one but what abut the rest of triggers how can i order them..please help me..in this i m new for trigger...
hi this is ajay rathi,
i am facing a very big problem,
select month(Start_date) as start_Month, year(Start_date) as start_Year,
sum(case when Status = 'Active' then 1
else 0 end) as Active,
sum(case when Status = 'Inactive' then 1
else 0 end) as Billed
from tbl_Post_Job where Company_Id_Fk = 60 and Start_date between Start_date and Exp_date group by year(Start_date), month(Start_date)order by year(Start_date), month(Start_date)
in this query i want many things,first of all i want to say this is not right query i want query from you..
(1)month(Start_date) as start_Month, year(Start_date) as start_Year
from this line i want month and year from Start_date to Exp_date
(2)in active condition,if any company's status is active from january to april so in this condition the entry of active should be come in january to april in every month
(3)group by year(Start_date), month(Start_date)
in group by section same problem,i want data from Start_date to exp_date
actually the main problem i m facing is this that when i need month and year together and active postion and billed position saperatlly..
actually i need this data in following form...
I am using MySql .NET Connector 5.1.2.
Following is the code I am using to read a longblob field from a table..
// Select from any table that ***HAS BLOB DATA FIELD***<br />string selCmd = "SELECT * FROM document";<br />
MySqlCommand allDocsCmd = new MySqlCommand(selCmd, con);<br />
MySqlDataReader reader = allDocsCmd.ExecuteReader();<br />
The execution hangs at reader.Close();
When I selected everything else but the blob field from the table and it worked fine i.e.
"select id,data from document" hangs but
"select id from document" works ok.
('data' is a LONGBLOB field in document table)
I am searching a cause and fix but lemme know if anyone has ne idea why this is happening..
-- modified at 9:56 Wednesday 10th October, 2007
Last Visit: 31-Dec-99 19:00 Last Update: 4-Feb-23 12:28