469,362 Members | 2,548 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,362 developers. It's quick & easy.

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.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
end if
End Function


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

Apr 18 '06 #1
0 2026

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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.