Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 29, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - Controls
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Controls | New ThreadView:  Search:  
 Author  Thread: Datagrid using a non-SLX OLE-DB Provider
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Datagrid using a non-SLX OLE-DB ProviderYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Aug 08 10:55 AM
How would you create a datagrid using an OLE-DB provider that is not SLX?

I've been playing around with the samples from Ryan and can't get it to work.

Thanks,
John G.
[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Datagrid using a non-SLX OLE-DB ProviderYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Aug 08 1:22 PM
After some more fiddlin' I came up with the below that seems to be working. My only question now is this. When do I close out the recordset? Do I do it just after the grid is populated or does the recordset have to exist the whole time the grid is displayed? Thanks.

Sub btnFillGridClick(Sender)
Dim objRS
Dim col
Dim fld
Dim i
Dim objCon
Dim strSQL

With grdInvoices

' Remove any existing columns
If (.Columns.Count > 0) Then
For i = 0 To .Columns.Count - 1
.Columns.Item(0).Delete
Next
End If

.ConnectionString = "YourProviderConnectionString"

strSQL = "SELECT fields FROM tablename WHERE condition"

' Add new SQL and refresh so grid is bound
.SQL.Text = strSQL
.Refresh

' Pull the recordset from grid to determine fields in query
Set objRS = .Recordset
For Each fld In objRS.Fields
Set col = .Columns.Add(0)
col.FieldName = fld.Name
col.Caption = fld.Name
' If field ends in "ID" then assume that field is hidden
If Right(LCase(fld.Name), 2) = "id" Then col.Visible = False
Next

.ReadOnly = True
.RowSelect = True
.Refresh
End With
End Sub
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/29/2024 11:31:57 PM