# Mysql insert into asp got pb

**URL:** <https://forum.kirupa.com/t/mysql-insert-into-asp-got-pb/227590>\
**Category:** Uncategorized\
**Created:** [May 31, 2007, 3:05pm UTC](https://forum.kirupa.com/t/mysql-insert-into-asp-got-pb/227590 "2007-05-31T15:05:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kitaeshi](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@kitaeshi](https://forum.kirupa.com/u/kitaeshi)\
**Post date:** [May 31, 2007, 3:05pm UTC](https://forum.kirupa.com/t/mysql-insert-into-asp-got-pb/227590/1 "2007-05-31T15:05:06Z")

</div>

bascially i create a form to pass value to another form to process n update to mysql. the code work fine if strFname n strLname is not variable, but when it try to pass it as variable i encounter errors.

i also tried

set sql = objConn.execute("INSERT person(fname, lname)VALUES([COLOR=Red] " & strFname & “,” & strLname & “[COLOR=Black])[/COLOR][/COLOR]”)

but it still have error…  
anyone know how to solve this pb. tks.

\<%@ language=vbscript %\>  
\<% option explicit %\>

\<%  
dim sql, conn, objConn, strFname, strLname

strFname = request(“fname”)  
strLname = request(“lname”)

set objConn = server.createObject(“ADODB.connection”)

conn = “DRIVER={MySQL ODBC 3.51 Driver}; server=localhost; database=hate; UID=admin; password=pass; option=3”

objConn.open(conn)

set sql = objConn.execute(“INSERT person(fname, lname)VALUES([COLOR=Red]strFname, strLname[COLOR=Black])[/COLOR][/COLOR]”)

%\>
