|
Hi,
Try this
DECLARE @str varchar(50)
When using space as the delimiter
---------------------------------
select @str = coalesce(@str+' ','')+Msg
from Table1
SELECT @str
Result:
Chennai Vilupuram Trichy Madurai
When using comma as the delimiter
---------------------------------
Result:
Chennai,Vilupuram,Trichy,Madurai
Senthil
|
|
|
|
|
hi;
i new in MFC and i have a problem with adding and deleting but basically i can attribute my problem to lack of proper tutorials on the same. ANy site i try to get tutorials i end up with getting complex stuff posted by Gurus tryiong to implement not the usual basic works that am in need of so i have been tring to understand the whole concept by following one simple code example i have and so in that connection if you know a site i can get real introduction tutorials to ADO in MFC i will appreciate but in the mean time
help me get thru this problem at hand(my name is king'ori from kenya);
I want to add supplierid (not null primary key) and suppliername(not null) to the SUPPLIERS table (which i have alreaady created);
so i have included the adofields.h in my project..,done the ::initialization, the opening() plus i have these functions
void MyView:: RefreshSupplier()
{
if(p_rsSupplier->BOFILE || p_rsSupplierEOFILE)
return;
m_strSupplierName =(const char*)_bstr_t(FieldValue(p_rsSupplier,"suppliername");
m_lSupplierID = long(FieldValue(p_rsSupplier,"supplierID"));
UpdateData(FALSE);
}
vooid MyView:: UpdateSupplier()
{
if(p_rsSupplier->BOFILE || p_rsSupplier->EOFILE)
retirn;
CString strSupplier;
long lsupplier;
UpgateData();
if(lSupplier != m_lSupplierID)
FieldValue(p_rsSupplier,"supplierid",m_lSupplierID);
if(strSupplier != m_strSupplierName)
FieldValue(p_rsSupplier,"suppliername",m_strSuppliername);
}
void MyView::BlankSupplier()
{
m_lSupplierID = 0;
m_strSupplierName = _T(" ");
}
problem comes i dont understand the adding flow,- for instance why do you have to blank the recordset? what comes first p_rsSupplier->Addnew() or is it UpdateSupplier() and why;
this is not working
void MyView::AddSupplier()
{
BlankSupplier(); //why this and my fields are not null?
p_rsSupplier->AddNew();
UpdateData();
p_rsSupplier->PutCollect(_variant_t("Suppliername",_variant((LPCTSTR)m_strName);
p_rsSupplier->PutCollect....suppierID);
p_rsSupplier->MoveNext();
RefreshSupplier();
}
void MyView::DeleteSupplier()
{
if(p_rsSupplier->BOFILE || p_rsSupplier->EOFILE)
{
if(Warning MSgBx ==YES)
{
p_rsSupplier->Delete(adAffectCurrent);
p_rsSupplier->MovePrevious();
RefreshSupplier();
}
|
|
|
|
|
hi;
i new in MFC and i have a problem with adding and deleting but basically i can attribute my problem to lack of proper tutorials on the same. ANy site i try to get tutorials i end up with getting complex stuff posted by Gurus tryiong to implement not the usual basic works that am in need of so i have been tring to understand the whole concept by following one simple code example i have and so in that connection if you know a site i can get real introduction tutorials to ADO in MFC i will appreciate but in the mean time
help me get thru this problem at hand(my name is king'ori from kenya);
I want to add supplierid (not null primary key) and suppliername(not null) to the SUPPLIERS table (which i have alreaady created);
so i have included the adofields.h in my project..,done the ::initialization, the opening() plus i have these functions
void MyView:: RefreshSupplier()
{
if(p_rsSupplier->BOFILE || p_rsSupplierEOFILE)
return;
m_strSupplierName =(const char*)_bstr_t(FieldValue(p_rsSupplier,"suppliername");
m_lSupplierID = long(FieldValue(p_rsSupplier,"supplierID"));
UpdateData(FALSE);
}
vooid MyView:: UpdateSupplier()
{
if(p_rsSupplier->BOFILE || p_rsSupplier->EOFILE)
retirn;
CString strSupplier;
long lsupplier;
UpgateData();
if(lSupplier != m_lSupplierID)
FieldValue(p_rsSupplier,"supplierid",m_lSupplierID);
if(strSupplier != m_strSupplierName)
FieldValue(p_rsSupplier,"suppliername",m_strSuppliername);
}
void MyView::BlankSupplier()
{
m_lSupplierID = 0;
m_strSupplierName = _T(" ");
}
problem comes i dont understand the adding flow,- for instance why do you have to blank the recordset? what comes first p_rsSupplier->Addnew() or is it UpdateSupplier() and why;
this is not working
void MyView::AddSupplier()
{
BlankSupplier(); //why this and my fields are not null?
p_rsSupplier->AddNew();
UpdateData();
p_rsSupplier->PutCollect(_variant_t("Suppliername",_variant((LPCTSTR)m_strName);
p_rsSupplier->PutCollect....suppierID);
p_rsSupplier->MoveNext();
RefreshSupplier();
}
void MyView::DeleteSupplier()
{
if(p_rsSupplier->BOFILE || p_rsSupplier->EOFILE)
{
if(Warning MSgBx ==YES)
{
p_rsSupplier->Delete(adAffectCurrent);
p_rsSupplier->MovePrevious();
RefreshSupplier();
}
|
|
|
|
|
in my project, i use toolbar toolbar in my buttons...i used case structure for the functions of each buttons in the toolbar but theres an error in it...
my codes goes like this:
Select Case
Case 0
Dim subjects As New subjects
subjects.Show()
Me.Hide()
Case 1
Dim file_maintenance As New file_maintenance
file_maintenance.Show()
Me.Hide()
Case 2
Dim grade_entry As New grade_entry
grade_entry.Show()
Me.Hide()
End Select
is this code correct???
or this:
dim keyin as integer
Select Case keyIn
Case 0
Dim subjects As New subjects
subjects.Show()
Me.Hide()
Case 1
Dim file_maintenance As New file_maintenance
file_maintenance.Show()
Me.Hide()
Case 2
Dim grade_entry As New grade_entry
grade_entry.Show()
Me.Hide()
End Select
in the first code, there is an error so i can't run my program...
in the other code, the 1st button is only functioning...
what is the really correct code for this???
|
|
|
|
|
Rharzkie wrote: what is the really correct code for this???
What is the correct forum for this question because I really don't see anything to do with SQL or databases in here!?
|
|
|
|
|
You would be better-off with the VB.Net forum. However, it looks like you haven't assigned any value to the keyIn variable.
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message".
|
|
|
|
|
Breaking forum rules will result in you getting no help.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
Hi Rharzkie,
In your first part of your code you didn't pass parameter for the case.
It should be
Select Case <parameter>
Case 0
Dim subjects As New subjects
subjects.Show()
Me.Hide()
Case 1
Dim file_maintenance As New file_maintenance
file_maintenance.Show()
Me.Hide()
Case 2
Dim grade_entry As New grade_entry
grade_entry.Show()
Me.Hide()
End Select
Senthil
|
|
|
|
|
I was successful in creating my Stored Procedure. But if tomorrow I want to access and see the code that I have written for the Stored Procedure how should I access that?
|
|
|
|
|
What in? SQL Server 2005? SQL Server 2000? How you view it depends on the database.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
What database are you using? It depends on what database platform you are using...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
It depends which database you are using, If you are using SQL Server, Goto Enterprise Manager and choose Database - > Stored Procedure's. Alternatively you can use Sp_helptext ProcedureName also.
|
|
|
|
|
how to get sql server 2005 last execution time? is there any system store procedure? plz help...
|
|
|
|
|
You could always find some way to look in the log file. Not sure if this is how you want to do it...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi all,
I have an application which uses MS Access, SQL Server and MYSQL as back ends
Only one connection is opened at a time
My problem is,
when i tried to open the my sql connection after closing an MS Access connection it shows the following error message, but no problem with the SQL Server
Cannot start your application. The workgroup information file is missing or opened exclusively by another user
I am using Connection15::Open to open the connection
I used same connection object to open all connection
Thanks
Sivan
www.ktsinfotech.com
|
|
|
|
|
I think that your connection string is not good.
Try and find another connection string.
I have a question: mysql works before you start access?
|
|
|
|
|
Yes If i started my sql at first then it works
i connected to my sql before connecting to ms access
but whenever i tried to connect to my sql after closing a connection to ms access then it shows this message
i am using the same connection object to connect to all these databases
my connection string is
"DRIVER={MySQL ODBC 3.51 Driver};Server=My Databasee server;DATABASE=My database;UID=My user name(root); pwd=my password"
pls correct me if there is anything wrong in this connection string
I'm using an odbc driver to connect to my sql(MySQL ODBC 3.51) with ADO
thanks
www.ktsinfotech.com
|
|
|
|
|
The text, ntext, or image data type cannot be selected as DISTINCT.
how to solve this problem
|
|
|
|
|
The best way to do this is to place your text/image type in a separate table and then reference them through an FK which can be handled with SELECT DISTINCT .
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Is there any single query to remove all tables, triggers, stored procedures in oracle DB?
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
|
|
|
|
|
DROP DATABASE dbname . Of course that also drops the database, but without the tables, triggers, etc..., it's just taking up space anyway.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I generally try to keep all of an application's tables, triggers, procedures, etc.. owned by a user that I refer to as a schema owner. This provides the ability at some point to
<br />
DROP USER <application_name> CASCADE; and everything is gone. This can especially come in handy with creating a backup database, complete with up to date data using an export file from a production database.
Chris Meech
I am Canadian. [heard in a local bar]
|
|
|
|
|
Hi,
Lets say I have 2 tables, DEALER and CARS whereby DEALER describes the details of the car dealer and CARS describes the details of the cars
that are for sale in a car dealer. So this implies that DEALER has many details of car dealers and CARS has many details of cars. So am I right in suggesting this is a many to many relationship since more than 1 dealer can sell the same car? If so how do I convert my tables so that I only have a one to many relationship?
Thanks for any information.
|
|
|
|
|
The normal method is to use a link table. Here's an example:
(Table dealer)
DealerID (PK)
DealerName
(Table car)
CarID (PK)
CarName
(Table DealerCars)
DealerID (FK to Dealer.DealerID)
CarID (FK to Car.CarID)
Note that these are really terrible field names, but they serve to get the point across. The car and dealer tables have no direct relationships. Instead, the link table describes the relationship between the two.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
When you break down a many-to-many relationship, you get two one-to-many relationships.
|
|
|
|