I am using ADO in VB to access an SQL database.
I create a connection, a command, a record set, etc...All that is working fine.
I retrieve a record from a Complaints table (the user enters the complaint # on the screen) and I display info from that table in a "header" area on the screen.
Now, I want to retrieve one or more records from the Complaints_Order table, using the complaint # as key, and display 6 fields from each of those records on the screen (below the header info)in a sort of grid or list format, with column headings. There could be several of those reocrds.
I managed to retrieve the records ok using a hierarchical flex grid, but I can't find a way to individually pre-set the column widths. All the column widths seem to default to the same width even though the data in each column varies greatly. They can be resized by the user, but it is a pain..
I'm not even sure that I should be using an hflexgrid for this application!!!
Is there a better or simpler way to do this?
The data is read-only...no updating necessary.
P.S. I am VERY new to VB, and I have spent the last couple of weeks reading articles in manuals, and on web sites. I have come to the conclusion that ADO is now the recommended way to go for new applications. However, in all this world of Data Lists, Combo Boxes, Data Grids, HFlex grids, etc..., I can't figure out what I should be using for this particular application. I need a "if you need to do this...this is what you should be using" type of document.
Can anyone please point me in the right direction.
Thank you very much for any help/comments.
Here is the code that I am using to get the Complaint_Orders info:
Private Sub GetOrders()
sqlString2 = _
"SELECT Prod_Order_Number as 'Order#', " & _
"Mill_Bswt as 'MlBswt', " & _
"Mrk_Brand_code as 'MrkBrand', " & _
"Brand_Description, " & _
"Complaint_Qty, " & _
"Net_Weight_Shipped as NetWtShpd " & _
"FROM Complaints INNER JOIN Complaint_Order ON Complaints.Complaints_Id = " & _
"Complaint_Order.Complaint_Id " & _
"WHERE Complaint_Number = "
cmd.CommandText = sqlString2 & txtTBComplaintNo.Text
hflxRecords.Clear
Set rs = cmd.Execute(noOfRcds, , adCmdText)
Set hflxRecords.DataSource = rs
I create a connection, a command, a record set, etc...All that is working fine.
I retrieve a record from a Complaints table (the user enters the complaint # on the screen) and I display info from that table in a "header" area on the screen.
Now, I want to retrieve one or more records from the Complaints_Order table, using the complaint # as key, and display 6 fields from each of those records on the screen (below the header info)in a sort of grid or list format, with column headings. There could be several of those reocrds.
I managed to retrieve the records ok using a hierarchical flex grid, but I can't find a way to individually pre-set the column widths. All the column widths seem to default to the same width even though the data in each column varies greatly. They can be resized by the user, but it is a pain..
I'm not even sure that I should be using an hflexgrid for this application!!!
Is there a better or simpler way to do this?
The data is read-only...no updating necessary.
P.S. I am VERY new to VB, and I have spent the last couple of weeks reading articles in manuals, and on web sites. I have come to the conclusion that ADO is now the recommended way to go for new applications. However, in all this world of Data Lists, Combo Boxes, Data Grids, HFlex grids, etc..., I can't figure out what I should be using for this particular application. I need a "if you need to do this...this is what you should be using" type of document.
Can anyone please point me in the right direction.
Thank you very much for any help/comments.
Here is the code that I am using to get the Complaint_Orders info:
Private Sub GetOrders()
sqlString2 = _
"SELECT Prod_Order_Number as 'Order#', " & _
"Mill_Bswt as 'MlBswt', " & _
"Mrk_Brand_code as 'MrkBrand', " & _
"Brand_Description, " & _
"Complaint_Qty, " & _
"Net_Weight_Shipped as NetWtShpd " & _
"FROM Complaints INNER JOIN Complaint_Order ON Complaints.Complaints_Id = " & _
"Complaint_Order.Complaint_Id " & _
"WHERE Complaint_Number = "
cmd.CommandText = sqlString2 & txtTBComplaintNo.Text
hflxRecords.Clear
Set rs = cmd.Execute(noOfRcds, , adCmdText)
Set hflxRecords.DataSource = rs