Different handling of OpenSchema by UDL vs DSN-les

Results 1 to 2 of 2

Thread: Different handling of OpenSchema by UDL vs DSN-les

  1. #1
    Marcos Veloz Guest

    Default Different handling of OpenSchema by UDL vs DSN-les

    This one is puzzling me to no end. I&#039ve searched the MS site with no luck so far.<BR><BR>I have a procedure that uses a DSN-less connection to open the schema (for columns) to dynamically generate a list field names. This list returned by a recordset comes back in the order the fields appear in the table. <BR><BR>To increase portability of the application, I am converting it to use a UDL file for connection information. When I changed this piece of code (and ONLY the connection piece of the code) the recordset now displays the fields in sorted alpha order. This presents several problems at other points in the application.<BR><BR>Both connection methods open the object, but the UDL approach sorts my field names for some reason.<BR><BR>Anyone have any ideas how to display the recordset of field columns in the order they were created?<BR><BR>code snippet:<BR><BR>&#039//DSN-less connection below<BR><BR>datastring = "DBQ=" & strDBLocation & " &#039// blah blah blah...<BR>set objConn = Server.CreateObject ("ADODB.Connection")<BR>objConn.Open datastring<BR><BR>&#039//UDL connection below<BR><BR>&#039 C_UDLFile = "UDLfile.UDL" <BR>&#039 DIM strUDLFullName<BR>&#039 strUDLFullName = Server.MapPath(C_UDLFile)<BR>&#039 set objConn = Server.CreateObject ("ADODB.Connection")<BR>&#039 objConn.ConnectionString = "File Name=" & strUDLFullName<BR>&#039 objConn.Open<BR><BR>Set rstSchema = objConn.OpenSchema(adSchemaColumns)<BR>rstSchema.F ilter = "TABLE_NAME = &#039" & strTable & "&#039"<BR><BR>Do While Not(rstSchema.EOF)<BR> response.write (rstSchema("COLUMN_NAME"))<BR> rstSchema.MoveNext<BR>Loop<BR>

  2. #2
    Marcos Veloz Guest

    Default RE: Different handling of OpenSchema by UDL vs DSN

    one relevant note to this, I am using the schema because I am also collecting other information on the columns such as data type otherwise I would use the fields collection.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts