472,119 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

add database in vbscript function

<script type="text/vbscript">
Function approve_OnClick()
dim mss
mess = MsgBox ("Are you sure to add?", 32+4, "Asking")
if mess = vbyes then
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"

conn.open "C:\db1.mdb"
sql="INSERT INTO Students (Name) Values ('test')"
on error resume next
conn.Execute sql,recaffected
if err=0 then
Response.Write("<h3>" & recaffected & " record added</h3>")
end if
conn.close
%>
end if
End Function

</script>


It doesn't work. Can we add sql in the Vbscript function?

Thanks.
Apr 18 '06 #1
0 2060

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

29 posts views Thread by Christopher Brandsdal | last post: by
16 posts views Thread by Mike Schinkel | last post: by
6 posts views Thread by rishabhshrivastava | last post: by
3 posts views Thread by Savvas Tsitouridis | last post: by
30 posts views Thread by fniles | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.