|
-
Jul 13th, 2006, 02:54 AM
#1
Thread Starter
Addicted Member
Simple SQL query
Hi All,
Select * from XYZ query will display result in this way:
Filed1-----Field2-----Field3
A----------A--------A
B----------B--------B
C----------C-------C
What query will display the result in this way?
Filed1-----A
Filed2-----A
Field3-----A
Thanks
-
Jul 13th, 2006, 03:37 AM
#2
Re: Simple SQL query
it will not display as you expect...if you want to display like that in vb you have to code it...
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Jul 13th, 2006, 05:33 AM
#3
Thread Starter
Addicted Member
Re: Simple SQL query
 Originally Posted by ganeshmoorthy
it will not display as you expect...if you want to display like that in vb you have to code it...
How can I display the SQL query result in form given below in Flexigrid.
Field1----A
Field2----B
Field3----C
Thanks
-
Jul 13th, 2006, 06:50 AM
#4
Re: Simple SQL query
You will need to start by adding the correct number of rows to the grid (using Recordset.Fields.Count ), then add the field names if you want (using Recordset.Fields(X).Name ), and finally add the data one column at a time.
See the "Fill a flexgrid" link in my signature for the 'normal' way to fill a flexgrid, which should give you some ideas for the code.
-
Jul 13th, 2006, 07:36 AM
#5
Re: Simple SQL query
If you are using MS SQL 2005 you can return a query like that - what is your backend DB?
-
Jul 17th, 2006, 01:30 AM
#6
Thread Starter
Addicted Member
Re: Simple SQL query
 Originally Posted by szlamany
If you are using MS SQL 2005 you can return a query like that - what is your backend DB?
I am using MSSQL server for my backend database.
-
Jul 17th, 2006, 05:49 AM
#7
-
Jul 17th, 2006, 11:15 PM
#8
Thread Starter
Addicted Member
Re: Simple SQL query
 Originally Posted by szlamany
2000 or 2005?
MSSQL 2000
-
Jul 18th, 2006, 08:56 AM
#9
Re: Simple SQL query
Well - 2000 doesn't have the functionality for that.
It is most likely easier to do as Si suggested - you know the number of columns from the returned recordset - you will need to loop through each column and add a row to the flexgrid - putting the HEADING of the column into that first flexgrid cell of each row.
Then as you loop through the rows of data in the recordset add a new column to the flexgrid - and since you are adding them in such a strange fashion it's probably easiest to use the .TEXTMATRIX(x,y) property of the flexgrid to actually load the data.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|