Reading from a table and writing to a Text file

Results 1 to 3 of 3

Thread: Reading from a table and writing to a Text file

  1. #1
    Seenu Guest

    Default Reading from a table and writing to a Text file

    Hi,<BR> i get an error when i execute this..code<BR><BR> stroutput =objrs.GetString(adClipString, -1 , vbTab, vbCrLf)<BR><BR><BR>error:<BR> ADODB.Recordset error &#039 800a0bb9&#039 <BR>The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. <BR>/kpscripts/dbasetoascii.asp, line 37 <BR><BR>i am attaching the code can anyone help<BR><BR><BR>&#060;%@ Language=VBScript %&#062;<BR> &#060;HTML&#062;<BR> &#060;HEAD&#062;<BR> &#060;META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"&#062;<BR> &#060;/HEAD&#062;<BR> &#060;BODY&#062;<BR> <BR> <BR> &#060;%<BR> Dim strPath<BR> strPath = "C:Inetpubdnppv\"<BR> strFile="customer_get.txt"<BR> <BR> Dim objFile,objFileText,stroutput,objrs,objconn,objfs, strsql<BR> Set objfs = server.CreateObject("Scripting.FileSystemObject")< BR> Set objconn = server.CreateObject("ADODB.Connection")<BR> Set objrs = server.CreateObject("ADODB.Recordset")<BR> objconn.Open "desktopUser"<BR> strsql = "select * from Users"<BR> <BR> objrs.Open strsql, objconn, 3<BR> <BR> set objrs = OBJConn.Execute(strsql) <BR> <BR> If objrs.BOF And objrs.EOF Then<BR> ConvertToFile = False<BR> End If<BR><BR><BR> stroutput =objrs.GetString(adClipString, -1 , vbTab, vbCrLf)<BR> <BR> Set objFileText = objfs.CreateTextFile(strPath & strFile)<BR> Set objFileText = objfs.OpenTextFile(strPath & strFile, 1, False)<BR> Set objFileText = objfs.OpenTextFile(strPath & strFile, 2, False)<BR> &#039 The false attribute is to set if the file can be overwritten or not.<BR> &#039 Default Value Is False<BR><BR> objFileText.Close &#039close the file<BR> <BR> Set objFile = Nothing<BR> objrs.Close<BR> Set objrs = Nothing<BR> ConvertToFile = True<BR><BR> %&#062;<BR> &#060;/body&#062;<BR> &#060;/html&#062;<BR><BR><BR>thanx<BR>seenu<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Reading from a table and writing to a Text fil

    &nbsp;<BR>In this line:<BR><BR>stroutput =objrs.GetString(adClipString, -1 , vbTab, vbCrLf)<BR><BR>adClipString is probably not defined, so it becomes zero.<BR><BR>adClipString is normally defined in the file "", which you need to include in your page.<BR><BR> can also simply omit the argument and it will work right! In fact, you can omit the -1, too. Thus:<BR><BR>stroutput = objrs.GetString(,, vbTab, vbCrLf)<BR><BR>You do need to "save the place" of the two arguments with the commas, as shown.<BR><BR>

  3. #3
    seenu Guest

    Default thanx for ur help bill it works great

    thank u

Posting Permissions

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