problems with a period in a string

Results 1 to 3 of 3

Thread: problems with a period in a string

  1. #1
    Joel M Guest

    Default problems with a period in a string

    hello,<BR> I&#039m calling a stored procedure that returns some info based on username and password parameters...but if any of those strings have a period I get a big fat error message, if I omit the period from the email it goes through (but naturally doesn&#039t find the record). Here&#039s the error:<BR>------------------------<BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e14&#039 <BR><BR>[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near &#039.&#039. <BR><BR>/com/lookup.asp, line 26 <BR>-----------------------<BR><BR>I know that there&#039s an escape sequence for the single quote problem [ replace(string, "&#039", "&#039&#039") ]... but is there something similar for periods? or is there some other way that I should be handling that. Here&#039s the code I&#039m using the call the SP:<BR>-------------------------<BR> email = "a@b.c"<BR> uid = "joel"<BR> <BR> sql = "sp_password_agent " & uid & ", " & email<BR><BR> conn.Open ("dsn=thedsn")<BR> rs.Source = sql<BR> rs.ActiveConnection = conn<BR> rs.Open<BR><BR>---------------------------<BR><BR>thanks in advance<BR>Joel

  2. #2
    Join Date
    Dec 1969

    Default Ummm...period not in a string?

    But you are *NOT* passing a string. You need apostrophes around a string to make SQL see it as a string. Without the apostrophes, it is trying to interpret that as a field name in the DB. I *suspect* that you need apostrophes around the uid value, as well.<BR><BR>Thus:<BR><BR>sql = "sp_password_agent &#039" & uid & "&#039, &#039" & email & "&#039"<BR><BR>If that doesn&#039t work, come whack on my head.<BR><BR><BR><BR><BR><BR>

  3. #3
    Joel M Guest

    Default Keep on rockin

    worked like a charm

Posting Permissions

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