初级问题:asp如何连sql数据库,并建个简单的表?
asp如何连sql数据库,并建个简单的表?这个应该算初级问题,谁来指点一下,数据库用户名:sa,密码:1234虽然简单,但望不吝赐教...
asp如何连sql数据库,并建个简单的表?
这个应该算初级问题,谁来指点一下,
数据库用户名:sa,密码:1234
虽然简单,但望不吝赐教 展开
这个应该算初级问题,谁来指点一下,
数据库用户名:sa,密码:1234
虽然简单,但望不吝赐教 展开
1个回答
展开全部
Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName
SqlDatabaseName = "sundata" '数据库名
SqlUsername = "sa" '用户名
SqlPassword = "1234" '用户密码
SqlLocalName = "local" '连接地址(本网用local,外网用IP)
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Connstr
建表SQL语法如下:
CREATE TABLE [表名] (
[自动编号字段名] Integer NOT NULL IDENTITY,
[字符型字段名] VarChar ,
[日期型字段名] DateTime ,
[备注型字段名] Text );
SqlDatabaseName = "sundata" '数据库名
SqlUsername = "sa" '用户名
SqlPassword = "1234" '用户密码
SqlLocalName = "local" '连接地址(本网用local,外网用IP)
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Connstr
建表SQL语法如下:
CREATE TABLE [表名] (
[自动编号字段名] Integer NOT NULL IDENTITY,
[字符型字段名] VarChar ,
[日期型字段名] DateTime ,
[备注型字段名] Text );
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询