mdlmain.bas

来自「< 飞鸿商品>>零售是基于VB+SQL2000开的商品零售管理」· BAS 代码 · 共 67 行

BAS
67
字号
Attribute VB_Name = "mdlMain"
Option Explicit

Public Conn As ADODB.Connection

Public UserName As String
Public SysCaption  As String
Public PrintHat As String
Public PrintEnd As String
Public IsPrint As Integer

Public SellEnd As Boolean
Public Back As Boolean

Private Sub Main()
Dim SQLstring As String
Dim SysBase As String
Dim Base As String
Dim UID As String
Dim PWD As String

If App.PrevInstance = True Then MsgBox "请不要运行多个程序实例!", 64: Exit Sub
If Dir(App.Path & "\connaction") = "" Then
  MsgBox "数据库连接文件不存在。请重新进行系统初始化!", 64
  Exit Sub
End If

Open App.Path & "\connaction" For Input Shared As #1
  Input #1, SysBase
Close #1

Base = Mid(SysBase, 1, InStr(SysBase, "/") - 1)
SysBase = Mid(SysBase, InStr(SysBase, "/") + 1)
UID = Mid(SysBase, 1, InStr(SysBase, "/") - 1)
PWD = Mid(SysBase, InStr(SysBase, "/") + 1)

SQLstring = "Provider=SQLOLEDB.1;Password=" & PWD & ";Persist Security Info=True;" & _
      "User ID=" & UID & ";Initial Catalog=pos;Data Source=" & Base
Set Conn = New ADODB.Connection
Conn.CursorLocation = adUseClient
Conn.ConnectionString = SQLstring
Conn.Open

frmLogin.Show

End Sub

Public Function Foot(YS As String, CS As String) As Boolean
  SellEnd = False
  frmFoot.lblSum.Caption = YS
  frmFoot.lblSums.Caption = CS
  frmFoot.lblYH.Caption = Format(Val(YS) - Val(CS), "0.00")
  frmFoot.Show 1
  Foot = SellEnd
End Function

Public Function BackFoot(Yuan As String, Xian As String) As Boolean
  Back = False
  frmBackFoot.lblSum.Caption = Yuan
  frmBackFoot.lblSums.Caption = Xian
  frmBackFoot.lbl.Caption = Format(CStr(Val(Yuan) - Val(Xian)), "0.00")
  frmBackFoot.Show 1
  BackFoot = Back
  
End Function

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?