List:General Discussion« Previous MessageNext Message »
From:MyLists Date:May 18 2003 8:10pm
Subject:Re: ASP and MySQL
View as plain text  
You will be much better off if  you decide to modify your code to something
like the following:

strSQL = "INSERT INTO tblFOO(Field1, Field2) VALUES('value1','value2')"
objConn.Open strConnection
ObjConn.Execute(strSQL)

Good luck,

Dennis


----- Original Message -----
From: "Hekuran Vokshi" <heki@stripped>
To: <mysql@stripped>
Sent: Sunday, May 18, 2003 4:32 PM
Subject: ASP and MySQL


> Hi all,
>
> I know it is bizarre using ASP and MySQL but that is the requirement that
we
> have. However I am having a bit of a problem. I have string variables and
> numeric variables that need inserting into a record set. The problem is
that
> whenever I have a string longer then 4 characters (that is any characters
> and has been tested many times) it does not inert it into the record set.
> I'll include the script bellow and the table. If you think that I am
missing
> something please tell me so, otherwise I have to put it down as a ODBC
> connectivity problem. By the way I am running MySQL 4.0.12-nt on win2K
> platform and IIS; phpMyAdmin (which incidentally works fine) and
> MyODBC-3.51.06.
>
> TABLE:
>
> Table comments : Banner rotation system
>
>       Field Type Null Default
>       bannerID   int(4) No
>       bannerName   varchar(255) Yes  NULL
>       bannerImage   varchar(255) Yes  NULL
>       bannerURL   varchar(255) Yes  NULL
>       bannerImpressions   int(8) Yes  NULL
>       bannerClickThrus   int(8) Yes  NULL
>
>
>  Indexes : Keyname Type Cardinality Field
>       PRIMARY  PRIMARY  7  bannerID
>
>
>        Space usage : Type Usage
>             Data 216 Bytes
>             Index 2,048 Bytes
>             Total 2,264 Bytes
>         Row Statistic : Statements Value
>             Format dynamic
>             Rows 7
>             Row length ø 30
>             Row size  ø 323 Bytes
>             Next Autoindex 8
>             Creation May 17, 2003 at 09:44 AM
>             Last update May 18, 2003 at 06:27 PM
>
>
> The script is:
>
> <%
> option Explicit
> Dim strConnect
> On Error Resume next
> strConnect = "Driver={mySQL}; Server=teneqe; Port=3306; Option=; Socket=;
> Stmt=; Database=banners; Uid=root; Pwd=;"
> %>
> <!-- METADATA Type="TypeLib" File="c:\program files\common
> files\system\ado\msado15.dll" -->
>
> <html><body>
>
> <%
>
>  Dim objRS, mySql, number, number1, strBannerName, strBannerUrl,
> strBannerImage, temp1
>
>  Set objRS = Server.CreateObject("ADODB.Recordset")
>
>  temp1 = "test"
>
>  strBannerName = "verr"
>  strBannerImage  = ",,rty.."
>  strBannerUrl  = "heki"
>  number   = 1234567890
>  number1  = 1234567890
>  mySql   = "bann"
>
>
>
>  objRS.Open mySql, strConnect, adOpenStatic, adLockPessimistic, adCmdTable
>
>  objRS.AddNew
>
>
>  objRS("bannerName")   = CStr(strBannerName)
>  objRS("bannerImage")   = CStr(strBannerImage)
>  objRS("bannerURL")   = CStr(strBannerUrl)
>  objRS("bannerImpressions")  = number
>  objRS("bannerClickThrus") = number1
>
>
>  objRS.Update
>  objRS.Close
>  Set objRS = nothing
>
>  objConn.Close
>  Set objConn = nothing
>
>  Response.write strBannerName & "<br>"
>  Response.write strBannerImage & "<br>"
>  Response.write strBannerUrl & "<br>"
>  Response.write number & "<br>"
>  Response.write number1 & "<br>"
>
>
>  If err.number>0 then
>   response.write "VBScript Errors Occured:" & "<br>"
>   response.write "Error Number=" & err.number & "<br>"
>   response.write "Error Descr.=" & err.description & "<br>"
>   response.write "Help Context=" & err.helpcontext & "<br>"
>   response.write "Help Path=" & err.helppath & "<br>"
>   response.write "Native Error=" & err.nativeerror & "<br>"
>   response.write "Source=" & err.source & "<br>"
>   response.write "SQLState=" & err.sqlstate & "<br>"
>  End if
>
>
> %>
>
> </body></html>
>
> Thanks in advance for your help.
> Regards
> Heki
>
>

Thread
ASP and MySQLHekuran Vokshi18 May
Re: ASP and MySQLMyLists19 May
RE: ASP and MySQLMike Hillyer20 May
  • MySQL stupid mailing list formatWilliam IT20 May
    • RE: MySQL stupid mailing list formatDaevid Vincent21 May
      • RE: MySQL stupid mailing list formatPeter Monk21 May
    • Re: MySQL stupid mailing list formatMichael Satterwhite21 May
    • Re: MySQL stupid mailing list formatJoel Rees21 May
    • RE: MySQL stupid mailing list formatFred Whipple22 May
      • Re: MySQL stupid mailing list formatDavid Shugarts22 May
        • Re: [OT] Mailing list reply-to mungingMichael T. Babcock22 May
      • RE: MySQL stupid mailing list formatDon Read22 May
        • [OT]Re: MySQL stupid mailing list formatJoel Rees23 May
  • Re: MySQL stupid mailing list formatgerald_clark20 May
  • Re: MySQL stupid mailing list formatMichael T. Babcock21 May
  • Re: MySQL stupid mailing list formatMichael T. Babcock21 May
RE: MySQL stupid mailing list formatMike Hillyer21 May
RE: MySQL stupid mailing list formatAndrew Braithwaite21 May
  • Not again... (Re: MySQL stupid mailing list format)Jeremy Zawodny21 May
    • Re: Not again... (Re: MySQL stupid mailing list format)Chris Kelch21 May
    • Re: Not again... (Re: MySQL stupid mailing list format)Michael T. Babcock22 May
Re: Not again... (Re: MySQL stupid mailing list format)Michael T. Babcock23 May
  • Re: Not again... (Re: MySQL stupid mailing list format)David Shugarts24 May
    • Re: Not again... (Re: MySQL stupid mailing list format)Roman Neuhauser24 May
RE: MySQL stupid mailing list formatDavid Brodbeck23 May
  • Re: MySQL stupid mailing list formatPhillip Blancher - Ontario Web23 May
    • Symbolic Link on MySQL 4.0.13Roberto Slepetys Ferreira23 May
      • Re: Symbolic Link on MySQL 4.0.13Victoria Reznichenko24 May
    • Re: Symbolic Link on MySQL 4.0.13Roberto Slepetys24 May