如何在SQL—Server建立表

jizehao 2003-12-13 07:45:04
如题。非常简单的表就成,给段代码瞧瞧,非常感谢。

当然有代码说明,或其它的相关文章更棒了,就非常非常非常 GOOD 了。
...全文
36 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
lk_cool 2003-12-13
  • 打赏
  • 举报
回复
引用ado
dim conn as new connection
Dim Compublishers As New ADODB.Command

Set Conn = New Connection
With Conn
.Provider = "sqloledb"
.ConnectionString = "User ID=sa;Password=" & Trim(Strpassword) & ";data source=" & Trim(Strservername) & ";initial catalog=OLTest"
.Open
End With


With Compublishers
.ActiveConnection = Conn
.CommandText = "create table temp (mc char(20),km char(20),sj datetime,jgl float(8),bmrs float(8),ksrs float(8),zgf float(8),zdf float(8))"
.Execute
End With
dzb1997 2003-12-13
  • 打赏
  • 举报
回复
是在里面吗?用企业管理器
ketao_78 2003-12-13
  • 打赏
  • 举报
回复
sql statement
SoHo_Andy 2003-12-13
  • 打赏
  • 举报
回复
或者使用ADOX,你在ADO的帮助中搜索ADOX就可以了,很多创建数据库对象的例子
我就不贴了
rainstormmaster 2003-12-13
  • 打赏
  • 举报
回复
http://www.vb-helper.com/howto_adox_create_database.html
SoHo_Andy 2003-12-13
  • 打赏
  • 举报
回复
Dim cn As New ADODB.Connection
Dim strSQL As String

strSQL = "create table table1(id numeric(10,0) not null, name char(16), age integer, sex bit,primary key(id))"
cn.Execute strSQL

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧