SQL数据库建立的问题
代码如下:SQL = "CREATE TABLE [dbo].[产品入库表] ("
SQL = SQL & "[name] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,"
SQL = SQL & "[price] [numeric](18, 0) IDENTITY (1, 1) NOT NULL ,"
SQL = SQL & "[number] [numeric](18, 0) IDENTITY (1, 1) NOT NULL ,"
SQL = SQL & "[datet] [datetime] NOT NULL ,"
SQL = SQL & "[content] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,"
SQL = SQL & ") ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]"
con.Execute SQL
Private Sub Form_Load()
Adodc1.ConnectionString = ConnectionString '设置ADO控件的连接字符串
= adCmdText '定义CommandType类型
Adodc1.CursorLocation = adUseClient '定义CursorLocation类型
Adodc1.LockType = adLockPessimistic '定义LockType类型
Adodc1.RecordSource = "select * from 产品入库表" '定义数据源,构造SQL语句
Adodc1.Refresh '刷新ADO数据控件
Dim i As Integer
For i = 1 To 6
Set txtFields(i - 1).DataSource = Adodc1
txtFields(i - 1).DataField = Adodc1.Recordset.Fields(i).Name
Next i
Set DataGrid1.DataSource = Adodc1
SetButtons True
End Sub
[local]1[/local]