
June 20th, 2000, 01:46 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 23
|
|
<i><b>Originally posted by : padmaja tallavajhala (coolpersona@hotmail.com)</b></i><br /><% <br /> 'establish connection to the database to open recordset<br /> '--------------------------------------------------------------------------------<br /> stDataPath = Server.mappath("accessdata esttravel raveldata.mdb")<br /> sSQL = "Select * from tbl_arrangements;" <br /> <br /> Set oConn = Server.CreateObject("ADODB.Connection")<br /> Set oRs = Server.CreateObject("ADODB.Recordset")<br /> oConn.Open "DBQ=" & stDataPath & ";Driver={Microsoft Access Driver (*.mdb)};" <br /> oRs.Open sSQL, oConn, 1, 3<br /> <br /> 'start moving through the records of the database<br /> '---------------------------------------------------------------------------------<br /> oRs.MoveFirst <br /><br />%><br /> <TABLE BORDER=1 COLS=<% = oRS.Fields.Count%>> <br /> <TR><br /> <% For Each oField In oRS.Fields %><br /> <TH> <% = oField.Name %> </TH><br /> <% Next %><br /> </TR><br /> <% Do While Not oRS.EOF %><br /> <TR><br /> <% For Each oField In oRS.Fields %><br /> <TD ALIGN=RIGHT><br /> <% If IsNull(oField) Then <br /> Response.Write " "<br /> Else<br /> Response.Write oField.Value<br /> End If %><br /> </TD> <br /> <% Next <br /> oRS.MoveNext %><br /> </TR><br /> <% Loop %><br /> </TABLE><br /><% oRs.Close<br /> Set oRs = Nothing %><br /><br />Hope this clarifies your doubt...  <br /><br />------------<br />Gal Tamir - Israel at 6/13/2000 9:56:54 AM<br /><br /><br />I have a very small problem ( I think so ).<br />I want to get a list of all the fields from a specific table.<br /><br />Can someone help me with that one ???<br /><br />Thanks,<br /><br />Gal.<br /><br />More info:<br />Let's say I have table named "DBUser"<br />and in that table there are 3 fields : "DBName" "DBFamily" "DBAddress".<br />How can I get these field names if I don't know them already ?<br /><br /><br />
|