ASP注册连接SQL问题

来源:百度知道 编辑:UC知道 时间:2024/05/12 19:45:14
<!-- #include file="../inc/head.asp" -->
<!-- #include file="include/conn.asp" -->

ps_loginname = chkinput(request("id_N"))
ps_password = chkinput(request("pwd_P"))
ps_repassword = chkinput(request("pwd1_P"))
ps_name = chkinput(request("UserName_C"))
ps_email = chkinput(request("email_E"))
ps_question = chkinput(request("ques"))
ps_answer = chkinput(request("answ"))
ps_person_id = chkinput(request("IDNO_D"))
ps_phone = chkinput(request("Tel_T"))
ps_sex = chkinput(request("sex"))
ps_address = chkinput(request("add_C"))
ps_zipcode = chkinput(request("zip_I"))
ps_assist_id = chkinput(request("assist_id"))
ps_handphone = chkinput(request("handphone"))
ps_job = chkinput(request("job"))

response.write "<br>

评论 ┆ 举报

最佳答案此答案由提问者自己选择,并不代表百度知道知识人的观点

回答:菜鹰
学长
4月13日 22:13 如果你是在本地服务器中测试程序,问题的主因有两个:
1)连接命令是否正确
连接一个SQL Server库
< %
set conn=server.CreateObject ("adodb.connection")
’创建一个Connection属性的对象conn
conn.Open "driver={SQL Server};server=localhost;UID=username;PWD=password;database=dataname"
’用conn.对象的open方法创建一个对SQL Server数据库的连接
% >
代码中conn的open方法是打开一个连接用的,后边跟一个字符串。driver={SQL Server}的意思是,连接的是一个SQL Server的库,server=localhost中的localhost代表的是本机的IP,你的数据库服务器IP是多少,这里就改成相应的值,UID和PWD这两个是登录数据库服务器的用户名和密码,最后一个选项是你要操作的数据库的名字。

如果没有问题就可能:
2)数据库的路径是否正确,SQL命令是否正确

SQL常用命令使用方法:
(1) 数据记录筛选:
sql="select * from 数据表 where 字段名=字段值 order by 字段名 "
sql="select * from 数据表 where 字段名 like ‘%字段值%‘ order by 字段名 "
sql="select top 10 * from 数据表 where 字段名 order by 字段名 "
sql="select * from 数据表 where 字段名 in (‘值1‘,‘值2‘,‘值3‘)&quo