?? frmtuihuo.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form FrmTuiHuo
BorderStyle = 3 'Fixed Dialog
Caption = "辦理退貨 選擇供應(yīng)商"
ClientHeight = 5130
ClientLeft = 45
ClientTop = 330
ClientWidth = 8820
Icon = "FrmTuiHuo.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5130
ScaleWidth = 8820
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Caption = "選擇供應(yīng)商"
Height = 3615
Left = 120
TabIndex = 4
Top = 120
Width = 8535
Begin VB.ComboBox ComboDanWei
Height = 300
Left = 1440
TabIndex = 0
Text = "請選擇供應(yīng)商"
Top = 360
Width = 2535
End
Begin VB.TextBox TxtDanWei
Height = 390
Left = 1440
TabIndex = 12
Top = 870
Width = 2535
End
Begin VB.TextBox TxtDiZhi
Height = 390
Left = 1440
TabIndex = 11
Top = 1380
Width = 2535
End
Begin VB.TextBox TxtDianHua
Height = 390
Left = 1440
TabIndex = 10
Top = 1890
Width = 2535
End
Begin VB.TextBox TxtChuanZhen
Height = 390
Left = 1440
TabIndex = 9
Top = 2400
Width = 2535
End
Begin VB.TextBox TxtMail
Height = 390
Left = 1440
TabIndex = 8
Top = 2880
Width = 2535
End
Begin VB.TextBox TxtLianXiRen
Height = 390
Left = 5160
TabIndex = 7
Top = 360
Width = 3135
End
Begin VB.TextBox TxtWeb
Height = 390
Left = 5160
TabIndex = 6
Top = 840
Width = 3135
End
Begin VB.TextBox TxtJianJie
Height = 1935
Left = 5160
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 5
Top = 1335
Width = 3135
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "選擇供應(yīng)商:"
Height = 180
Left = 240
TabIndex = 21
Top = 480
Width = 1080
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "單位名稱:"
Height = 180
Left = 420
TabIndex = 20
Top = 1005
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "單位地址:"
Height = 180
Left = 420
TabIndex = 19
Top = 1515
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "電話:"
Height = 180
Left = 780
TabIndex = 18
Top = 2010
Width = 540
End
Begin VB.Label Label6
Caption = "傳真:"
Height = 255
Left = 705
TabIndex = 17
Top = 2520
Width = 615
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "E-mail:"
Height = 180
Left = 600
TabIndex = 16
Top = 3000
Width = 720
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "聯(lián)系人:"
Height = 180
Left = 4380
TabIndex = 15
Top = 480
Width = 720
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "單位主頁:"
Height = 180
Left = 4200
TabIndex = 14
Top = 960
Width = 900
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "單位簡介:"
Height = 180
Left = 4200
TabIndex = 13
Top = 1440
Width = 900
End
End
Begin VB.Frame Frame2
Caption = "信息管理"
Height = 975
Left = 120
TabIndex = 3
Top = 3960
Width = 8535
Begin VB.CommandButton CmdClose
Cancel = -1 'True
Caption = "關(guān)閉(&C)"
Height = 375
Left = 5760
TabIndex = 2
Top = 360
Width = 1575
End
Begin VB.CommandButton CmdSelect
Caption = "選中供應(yīng)商(&G)"
Height = 375
Left = 1320
TabIndex = 1
Top = 360
Width = 1575
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 4200
Top = 3960
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
End
Attribute VB_Name = "FrmTuiHuo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Function checkGYSID(UID As String) As Boolean
Dim userDB As Database
Dim userRD As Recordset
Dim dbName As String
Dim STRSQL As String
Screen.MousePointer = 11
On Error GoTo errEnd
dbName = App.Path
If Right(dbName, 1) <> "\" Then dbName = dbName + "\"
dbName = dbName + "DataBase\WFSSDataBase.mdb"
STRSQL = "select [供應(yīng)商] from [供應(yīng)商] where [供應(yīng)商編號]=""" & UID & """"
'打開數(shù)據(jù)庫
Set userDB = DBEngine.Workspaces(0).OpenDatabase(dbName, False, True)
'檢索用戶,驗證密碼
Set userRD = userDB.OpenRecordset(STRSQL, dbOpenSnapshot)
If userRD.RecordCount > 0 Then
'關(guān)閉數(shù)據(jù)庫
userRD.Close
Set userRD = Nothing
userDB.Close
Set userDB = Nothing
checkGYSID = True
Screen.MousePointer = vbDefault
Else
'關(guān)閉數(shù)據(jù)庫
userRD.Close
Set userRD = Nothing
userDB.Close
Set userDB = Nothing
Screen.MousePointer = vbDefault
checkGYSID = False
End If
Exit Function
errEnd:
Screen.MousePointer = vbDefault
MsgBox Err.Description, vbOKOnly + vbExclamation, "供應(yīng)商登記"
Err.Clear
'關(guān)閉數(shù)據(jù)庫
userRD.Close
Set userRD = Nothing
userDB.Close
Set userDB = Nothing
End Function
Private Sub CmdClose_Click()
Unload Me
End Sub
Private Sub CmdSelect_Click()
If ComboDanWei.Text <> "" And ComboDanWei.Text <> "請選擇供應(yīng)商" Then
If checkGYSID(ComboDanWei.Text) Then
'新書登記
GongYingShangID = ComboDanWei.Text
Unload Me
Load FrmTHBook
FrmTHBook.Show vbModal
Else
MsgBox "該供應(yīng)商不存在,請先選擇或登記!", vbOKOnly + vbExclamation, "選擇供應(yīng)商"
ComboDanWei.SetFocus
End If
Else
MsgBox "請選擇供應(yīng)商!", vbOKOnly + vbExclamation, "選擇供應(yīng)商"
ComboDanWei.SetFocus
End If
End Sub
Private Sub ComboDanWei_Click()
On Error GoTo errEnd
If ComboDanWei.Text <> "" And ComboDanWei.Text <> "請選擇供應(yīng)商" Then
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from [供應(yīng)商] where [供應(yīng)商編號]=""" & ComboDanWei.Text & """"
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
TxtDanWei.Text = Adodc1.Recordset!供應(yīng)商 & ""
GongYingShang = Adodc1.Recordset!供應(yīng)商 & ""
TxtDiZhi.Text = Adodc1.Recordset!地址 & ""
TxtWeb.Text = Adodc1.Recordset!網(wǎng)址 & ""
TxtLianXiRen.Text = Adodc1.Recordset!聯(lián)系人 & ""
TxtDianHua.Text = Adodc1.Recordset!電話 & ""
TxtChuanZhen.Text = Adodc1.Recordset!傳真 & ""
TxtMail.Text = Adodc1.Recordset!電子郵件 & ""
TxtJianJie.Text = Adodc1.Recordset!單位簡介 & ""
End If
Exit Sub
errEnd:
MsgBox "檢索數(shù)據(jù)庫失敗!", vbOKOnly + vbExclamation, "數(shù)據(jù)庫出錯"
End Sub
Private Sub Form_Activate()
On Error GoTo errEnd
ComboDanWei.Text = "請選擇供應(yīng)商"
If Adodc1.Recordset.RecordCount > 0 Then
While Not Adodc1.Recordset.EOF
ComboDanWei.AddItem Adodc1.Recordset!供應(yīng)商編號
Adodc1.Recordset.MoveNext
Wend
Else
MsgBox "目前沒有供應(yīng)商,請先登記供應(yīng)商情況!", vbOKOnly + vbExclamation, "沒有記錄"
CmdSelect.Enabled = False
CmdUpdate.Enabled = False
End If
Exit Sub
errEnd:
MsgBox "檢索數(shù)據(jù)庫失敗!", vbOKOnly + vbExclamation, "數(shù)據(jù)庫出錯"
End Sub
Private Sub Form_Load()
Dim dbName As String
Dim connSTR As String
On Error GoTo errEnd
ChDir App.Path
dbName = App.Path
If Right(dbName, 1) <> "\" Then dbName = dbName + "\"
dbName = dbName + "DataBase\WFSSDataBase.mdb"
connSTR = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbName & ";Persist Security Info=False"
Adodc1.ConnectionString = connSTR
Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "供應(yīng)商"
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
Exit Sub
errEnd:
MsgBox "連接數(shù)據(jù)庫失敗!", vbOKOnly + vbExclamation, "打開數(shù)據(jù)庫出錯"
End
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -