returning an inproper value when using DSN


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: returning an inproper value when using DSN

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    returning an inproper value when using DSN

    [Originally posted by Paul Rovers]

    normally I do not use dsn, this time I had to because I'm using dbf file instead of a mdb file
    the asp in this message is working but
    the output on the page is
    ˙
    ˙ name : test person
    ˙ contact1 : 
    ˙ contact2 : 


    in the database the name field is specified as text and the contact fields as memo

    the contact fields in the database need to stay a memo field

    what can I do to make it work ?˙ what is wrong ?

    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open "DSN=DBF;Uid=username;Pwd=password;"
    Set RS = Server.CreateObject("ADODB.RecordSet")
    sql = "SELECT * FROM all2"
    RS.Open SQL, Conn,1,1

    if RS.BOF And RS.EOF then
    this database is empty

    else
    if RS(&quot;name&quot;) <> &quot;&quot; then&nbsp;
    naam : =RS(&quot;name&quot;)

    end if
    if RS(&quot;contact1&quot;) <> &quot;&quot; then&nbsp;
    contact1 : =RS(&quot;contact1&quot;)

    end if
    if RS(&quot;contact2&quot;) <> &quot;&quot; then&nbsp;
    contact2 : =RS(&quot;contact2&quot;)

    end if

    end if

    RS.Close
    Conn.Close
    Set RS = Nothing
    Set Conn = nothing

    I'm dutch so do not mind all write mistakes :)

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:returning an inproper value when using DSN

    [Originally posted by FreeVBCode.com]

    I don't know why are getting those characters, but you can remove them.˙ There is a routine on this site that trims all non-printing characters from a string, see <A HREF = 'http://www.freevbcode.com/ShowCode.ASP?ID=104'>http://www.freevbcode.com/ShowCode.ASP?ID=104</A>. It's for VB but it should be easy to adapt for ASP; just remove the type declarations.

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:returning an inproper value when using DSN

    [Originally posted by Paul Rovers]

    the problem is that those values are the most important in my database without that information the database is useless.

    I think it's the server administrator who has made a mistake but I do not know what the problem is because I do not get a fault message

    maybe there's a script that can check what is wrong with the server or something
    atleast I hope so

  4. #4
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:returning an inproper value when using DSN

    [Originally posted by FreeVBCode.com]

    I'm sorry, I did not look closely enough at your original message.˙ You are getting junk instead of the actual contact information, correct?

    All I can say is that your ASP looks fine and that you need to check the˙ .dbf itself if the values are there and if the .dbf's tables are correctly configured.˙ Maybe you can set up a linked access table.˙ Sorry I can't help you further.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center