카테고리 없음2011. 12. 10. 01:41

www.softwaredevelopmentdeveloper.com

옥션 아이폰/아이팟 집에서 즐기기 롯데마트 11번가 주민등록번호 도용사실이 있는지 확인해 보세요! CJmall 회원가입 도메인 NO.1-호스팅 NO.1 든든한 웹파트너 가비아 ! 건담 전문몰 건담샵 No.1 중고차 쇼핑몰! SK엔카

아래출처는 http://ad.web2r.net/r.php?c=shop 입니다.' Check for existence of Server, Database and User Name ' If missing, inform user and exit. If IsNull(Me!txtServer) Then strMsg = "Enter name of your company's Server." & _ & "(See your database administrator)" MsgBox strMsg, vbInformation, "Missing Data" Me!txtServer.SetFocus ElseIf IsNull(Me!txtDatabase) Then strMsg = "Enter name of database. (Example: PUBS)" MsgBox strMsg, vbInformation, "Missing Data" Me!txtDatabase.SetFocus ElseIf IsNull(Me!txtUID) Then strMsg = "Enter user login. (Example: sa)" = "" MsgBox strMsg, vbInformation, "Missing Data" Me!txtDatabase.SetFocus Else strServer = Me!txtServer strDatabase = Me!txtDatabase strUID = Me!txtUID 'Password may be NULL, so provide for that possibility strPWD = Nz(Me!txtPWD, "") 'Prepare connection string strConnect = "ODBC;DRIVER={SQL Server}" _ & ";SERVER=" & strServer _ & ";DATABASE=" & strDatabase _ & ";UID=" & strUID _ & ";PWD=" & strPWD & ";" End If Private Sub CheckForStoredProcs() On Error Resume Next Dim qdf As DAO.QueryDef Dim dbs As DAO.Database Dim rst As DAO.Recordset Dim sSQL As String 'Open arecordset of the stored procs to be used, and tested for. Set dbs = CurrentDb sSQL = "select ProcObjectName, ProcText from tblSQLProcList" Set rst = dbs.OpenRecordset(sSQL, dbOpenSnapshot) 'Create aquerydef object and set its CONNECT property. Set qdf = dbs.QueryDefs( "qryCheckProcs") qdf.Connect = strConnect qdf.ReturnsRecords = True 'Loop through the list, check for existance and create if needed. Do Until rst.EOF sSQL = "select count(*) as ProcExists from sysobjects " & _ "where Name='" & rst!ProcObjectName & "'" qdf.SQL = sSQL If DLookup( "[ProcExists]", "[qryCheckProcs]") = 0 Then '(ProcText contains the script to create the stored proc.) qdf.SQL = rst!ProcText qdf.ReturnsRecords = False qdf.Execute End If rst.MoveNext Loop Err.Clear Set rst = Nothing Set qdf = Nothing Set dbs = Nothing End Sub 'sql server의 Stored Procedure를 실행한다Set dbs = CurrentDb Set qdf = dbs.QueryDefs( "qryCurrentProc") sSQL = "exec " & lstProcs.Column(1) qdf.SQL = sSQL If txtPercent.Enabled Then sSQL = sSQL & " @percentage=" & txtPercent If txtLoLimit.Enabled Then sSQL = sSQL & " @LoLimit=" & txtLoLimit & ", " If txtHiLimit.Enabled Then sSQL = sSQL & " @HiLimit=" & txtHiLimit & ", " If txtType.Enabled Then sSQL = sSQL & " @Type='" & txtType & "'" If txtEmployee.Enabled Then sSQL = sSQL & " @Employee='" & txtEmployee & "'" If txtStart.Enabled Then sSQL = sSQL & " @Start='" & txtStart & "', @End='" & txtEnd & "'" Me.lblQuery.Caption = sSQL qdf.SQL = sSQL

크리에이티브 커먼즈 라이선스

Share |

Posted by 아이맥스