VB中的变量声明 [英] variable declaration in VB
本文介绍了VB中的变量声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在VB中声明变量?
对我来说这是新的,我无法在下面的代码中解决.
How to Declare A variable in VB?
Its new for me i cant solve an in following code.
nm = Request("full_name")
cn = Request("contact_no")
em = Request("e-mail")
msg = Request("message")
Set conn = Server.CreateObject("ADODB.Connection")
connectionString = "DSN=MyDSN"
conn.Open(connectionString)
sql = "INSERT INTO contact VALUES ('"&nm&"','"&cn&"','"&em&"','"&msg&"')"
REM Response.Write(sql)
conn.execute(sql)
conn.close();
Response.Write("successfully submitted")
推荐答案
在名称前加上Dim
字样:
Put the wordDim
in front of the name:
Dim nm = Request("full_name")
Dim cn = Request("contact_no")
Dim em = Request("e-mail")
Dim msg = Request("message")
这篇关于VB中的变量声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文