displaying database table on web page

Results 1 to 2 of 2

Thread: displaying database table on web page

  1. #1
    Join Date
    Dec 1969

    Default displaying database table on web page

    i am a complete beginer to asp. all i want to do is to display my news dbtable (author, news item and date)on the web. i have tried the examples from ms knowledge base and from your answers, but i must be doing something wrong. can someone help.<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: displaying database table on web page

    Ummm...go to http://www.4guysfromrolla.com and use the search for all types of info, for now though I&#039;ll give you the code to connect, obviously you need to change where appropriate:<BR><BR>Set Con=Server.CreateObject("ADODB.Connection")<BR>Con .Open "yourdb"<BR><BR>Set RS=Server.CreateObject("ADODB.Recordset")<BR>RS.Ac tiveConnection=Con<BR><BR>sqlString="SELECT * FROM news"<BR>RS.Open sqlString<BR><BR>WHILE NOT RS.EOF<BR>response.write RS("author") & "<BR>" & RS("news") & "<BR>" & RS("item") & "<BR>" & RS("date")<BR><BR>RS.MoveNext<BR>Wend<BR><BR>Note : sql wont accept a statement with date in it as it&#039;s already a VB function so what we do is put them in square brackets i.e.<BR><BR>"SELECT [date] FROM news"<BR><BR>the "*" simply means all fields.<BR><BR>I hope this helps you, for a more detailed description on how to do things visit the site I listed above or:<BR><BR>http://www.asp101.com

Posting Permissions

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