Database Help

Results 1 to 3 of 3

Thread: Database Help

  1. #1
    Join Date
    Dec 1969

    Default Database Help

    Can someone tell me or direct me to a reference to what&#039;s the best way to grab the data contained in a column in a database and write that information to a txt or csv file? <BR><BR>Thanks!

  2. #2
    Join Date
    Dec 1969

    Default RE: Database Help

    I use query analizer and select the data from a table i want.<BR>I then just select the returned data copy and paste into notepad.

  3. #3
    Join Date
    Dec 1969

    Default A quick modification of

    the sample program on this page:<BR><BR><BR>will allow you to write the stuff to a file<BR> <BR>&#039;Open the FileSysObject here<BR>whichDSN="DSN=Student;uid=student;pwd=magi c"<BR>mySQL="select * from publishers where state=&#039;NY&#039;"<BR><BR>set conntemp=server.createobject("adodb.connection")<B R> whichDSN<BR>set rstemp=conntemp.execute(mySQL)<BR>for each whatever in rstemp.fields &#039;Put Headings in a string<BR> hdrTemp0=hdrTemp0 & & ","<BR>next<BR>&#039;write hdrTemp0 to the filesysObject <BR>&#039; user left(hdrTemp0,len(hdrTemp0)-1) to delete trailing ","<BR><BR><BR>You can now write the following command directly to<BR> the filesys object ... don&#039;t have to put it in a <BR>string variable:<BR><BR>rstemp.getstring(,, ",", chr(10) & chr(13), "-null-")<BR><BR>&#039;close everything here<BR><BR><BR>in the above string, the 3rd arugment (",") will put a comma between each column, and the 4th argument ( chr(10) & chr(13)) should put a cr lf after each line. The 5th argument will put "-null-" in any column that is empty.<BR><BR>HTH

Posting Permissions

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