【正文】
strtemp amp。 。Data Source= amp。UID=sa。Server=(local)。 車輛信息管理車輛信息管理窗體的程序如下:Sub refreshform2() For i = 0 To 6 Text1(i).Text = (i) Text1(i).Locked = True NextEnd SubSub refreshform() Dim str2 As String str2 = select * from 車輛信息表 = str2 Dim i As Integer For i = 0 To 6 Text1(i).Text = (i) Text1(i).Locked = TrueNextEnd SubPrivate Sub Form_Load() = ( ) / 2 = ( ) / 2Call refreshformEnd SubPrivate Sub Toolbar1_ButtonClick(ByVal Button As )Select Case Case 1 Dim i As Integer For i = 0 To 6 Text1(i).Locked = False Text1(i).Text = Next Text1(0).SetFocus Case 2 For i = 0 To 6 If Text1(i).Text = Then MsgBox 數(shù)據(jù)不能為空,請(qǐng)重新輸入, vbInformation + vbOKOnly, 提示 Exit Sub End If Next For i = 0 To 6 (i) = Text1(i) Text1(i).Locked = True Next Call refreshform Case 3 For i = 0 To 6 Text1(i).Locked = False Next Case 4 Dim y As Integer y = MsgBox(確定刪除該條信息嗎?, vbQuestion + vbOKCancel, 提示) If y = 1 Then If Then End If Else Exit Sub End If Call refreshform Case 5 Dim r As Integer, c As Integer Dim newxls As Dim newbook As Dim newsheet As Set newxls = CreateObject() Set newbook = Set newsheet = (1) If 0 Then For i = 0 To 1 (1,i + 1) = (i).Caption Next i Do Until r = For c = 0 To 1 = c (r + 1, c + 1) = (c) Next c Loop Dim myval As Long Dim mystr As String myval = MsgBox(是否保存該Excel表?, vbYesNo, 提示窗口) If myval = vbYes Then With CommonDialog1 .Filter = Excel文件(*.xls) .DialogTitle = 保存 .ShowSave End With End If Dim strname As String strname = If Len(strname) 0 Then strname End If On Error GoTo ErrSaveErrSave: Exit Sub MsgBox , , 提示窗口 End If Case 6 Dim str As String str = select * from 車輛信息表 = str If And Then GoTo line1 End IfDim k, m As Integer k = 0 Do While = False k = k + 1 Loop For m = 1 To k Nextline1: Dim strconn As String Dim As Set = New = 電子表格文件(.xls) |*.xls = 請(qǐng)選擇要導(dǎo)入的文件 If = 32755 Then Unload Me End Ifstrtemp=[odbc。 供應(yīng)商編輯供應(yīng)商編輯界面的程序如下:Private Sub Form_Load() = 供應(yīng)商管理 = ( ) / 2 = ( ) / 2Call refreshformEnd SubPrivate Sub Toolbar1_ButtonClick(ByVal Button As )Select Case Case 1 For i = 0 To 7 Text1(i).Locked = False Text1(i).Text = Next Text1(0).SetFocus Case 2 For i = 0 To 6 If Text1(i).Text = Then MsgBox 數(shù)據(jù)不能為空,請(qǐng)重新輸入, vbInformation + vbOKOnly, 提示 Exit Sub End If Next For i = 0 To 7 (i) = Text1(i) Text1(i).Locked = True Next Case 3 For i = 0 To 7 Text1(i).Locked = False Next Case 4 Dim j As Integer j = MsgBox(確定要?jiǎng)h除該條信息嗎?, vbQuestion + vbOKCancel, 提示) If j = 1 Then Else Exit Sub End If If Then Call refreshform Case 5 Unload Me Unload frmsupplytableEnd SelectEnd Sub 通過運(yùn)輸車輛管理菜單下的車輛信息管理菜單。 = strIf Then MsgBox 沒有找到所需信息, vbExclamation + vbOKOnly, 提示 = str = select * from 供應(yīng)商 = str End IfEnd SubPrivate Sub Command2_Click() = Dim str As Stringstr = select * from 供應(yīng)商 = strEnd SubPrivate Sub Form_Load() = ( ) / 2 = ( ) / 2With Combo1 .AddItem 供應(yīng)商編號(hào) .AddItem 供應(yīng)商名稱 .AddItem 供應(yīng)產(chǎn)品End With = 供應(yīng)商編號(hào)End Sub 。 amp。 like 39。 供應(yīng)商查詢供應(yīng)商查詢界面程序如下:Private Sub Command1_Click()Dim str As Stringstr = select * from 供應(yīng)商 where 供應(yīng)商. amp。 .供應(yīng)商 select * from [sheet1$] strSql, lngRecsAff, adExecuteNoRecords MsgBox 成功導(dǎo)入到SQL 數(shù)據(jù)庫中!, vbExclamation + vbOKOnly Set = Nothing Call refreshform Case 5 Unload MeEnd SelectEnd Sub 。 Extended Properties=Excel strconn strSql = insert into amp。 amp。PWD=sa] strconn = Provider =。Database=管理信息系統(tǒng)。Driver={SQL Server} 。該窗體能夠?qū)崿F(xiàn)供應(yīng)商的查詢、編輯、從excel中導(dǎo)入及導(dǎo)出功能。 39。 amp。), Do While Not kill amp。password=sa select spid from master..sysprocesses where dbid=db_id(39。DataSource=ADMINIS63D99FD。server=ADMINIS63D99FD。If = 0 The