ActiveX, но не для всех пользователей. |
Private Sub Form_Open(Cancel As Integer) If UserIDActiveX=True Then AVAYAConnectorForm1.ConnectToAVAYA Else AVAYAConnectorForm1 = Nothing End If
http://www.sql.ru/forum/1205539/activex-no-ne-dlya-vseh-polzovateley
|
в combobox фильтруется список как то непонятно |
http://www.sql.ru/forum/1205328/v-combobox-filtruetsya-spisok-kak-to-neponyatno
|
запись кода ошибки БД в таблицу |
http://www.sql.ru/forum/1205251/zapis-koda-oshibki-bd-v-tablicu
|
Составить правильно запрос |
|
Ошибка run-time error 3021 |
Dim rst As DAO.Recordset Dim log As String Dim pass As String log = Me.username pass = Me.password Set rst = CurrentDb.OpenRecordset("SELECT Пользователи.id AS result_2 FROM Пользователи WHERE Пользователи.Логин = '" & log & "' AND Пользователи.Пароль='" & pass & "';") 'выше возникает ошибка 3021, а ниже проверка и если она присутствует, то выдает ошибку If (rst!result_2 Is EOL) Then t_ans = 0 MsgBox "Ошибка авторизации" Else t_ans = rst!result_2 End If rst.Close Set rst = Nothing
|
как ввести в команду TransferSpreadsheet переменные из формы |
http://www.sql.ru/forum/1205174/kak-vvesti-v-komandu-transferspreadsheet-peremennye-iz-formy
|
Access выдает ошибку application-defined or object-defined error |
http://www.sql.ru/forum/1205168/access-vydaet-oshibku-application-defined-or-object-defined-error
|
Вывод в файл в UTF-8 |
Private Sub button01_Click() 'delete old filedata Call ClearTablesRef 'link new file Call LinkSchema ' End Sub Function LinkSchema() Dim db As Database, tbl As TableDef, filename As String, rst As Recordset, arr() Set db = CurrentDb() Set tbl = db.CreateTableDef("SourceData") ' Append selection of any file through a dialog box filename = "Asci.txt" Call SchemaIniCreate(filename) ' Connect to the data source file tbl.Connect = "Text;DATABASE=" & CurrentProject.Path & ";TABLE=" & filename & "" tbl.SourceTableName = filename With db.TableDefs .Append tbl .Refresh End With ' Find error in file strSql = "SELECT SourceData.pid, SourceData.Sname, SourceData.Fname, SourceData.fday " & _ "FROM SourceData GROUP BY SourceData.pid, SourceData.Sname, SourceData.Fname, SourceData.fday " & _ "HAVING ((Count(*) Mod 2)=1)" Set rst = db.OpenRecordset(strSql) If rst.RecordCount > 0 Then Call ErrLogCreate(funMsgListRecord(strSql)) Call MsgBox("Import with errors!", vbCritical, "ERRORS!") End If End Function ' Create schema.ini for .csv or .txt file ' If the column names, number of columns, or type columns of data will be changed - edit this part of the code. Function SchemaIniCreate(filename As String) Dim create_file_name As String create_file_name = CurrentProject.Path & "\schema.ini" Open create_file_name For Output As #1 Print #1, "[" & filename & "]" Print #1, "Format = Delimited(;)" 'IN USE. Use only one! 'Print #1, "Format = Delimited(,)" 'Use only one! Print #1, "MaxScanRows = 0" Print #1, "ColNameHeader = False" Print #1, "CharacterSet = 65001" Print #1, "DecimalSymbol = ." Print #1, "CurrencyDecimalSymbol = ." Print #1, "Col1=""ouid"" Long Width 10" Print #1, "Col2=""did"" Long Width 10" Print #1, "Col3=""pid"" Long Width 10" Print #1, "Col4=""fday"" DateTime Width 30" Print #1, "Col5=""ftime"" DateTime Width 30" Print #1, "Col6=""punch"" Byte Width 3" Print #1, "Col7=""Sname"" Char Width 100" Print #1, "Col8=""Fname"" Char Width 100" Close #1 End Function ' Create Error Description Function funMsgListRecord(ByVal sSQL As String) Dim rst As DAO.Recordset Dim sListMsg As String Dim Output As String On Error GoTo Err_ Set rst = CurrentDb.OpenRecordset(sSQL, dbOpenSnapshot) With rst If Not (.BOF And .EOF) Then .MoveLast .MoveFirst Do Until .EOF If sListMsg = "" Then Output = "id:" & !PID & ", Name: " & !Sname & " " & !fname & ", Date:" & !fDay & "" sListMsg = Output Else Output = "id:" & !PID & ", Name: " & !Sname & " " & !fname & ", Date:" & !fDay & "" sListMsg = sListMsg & ""
& vbCrLf & Output End If .MoveNext Loop End If .Close End With Set rst = Nothing funMsgListRecord = sListMsg Exit Function Err_: MsgBox Err.Description Err.Clear End Function ' Create errorlog.html if .csv or .txt contain error Function ErrLogCreate(errmsg As String) Dim errorlog As String errorlog = CurrentProject.Path & "\errorlog.html" Open errorlog For Output As #2 Print #2, "" Print #2, "Errors in the import file:
" Print #2, "" & errmsg & "
" Print #2, "" Close #2 End Function
|
Access. Календарь. Обновить значение поля, к которому привязан календарь. |
|
Запрос данных |
|
Создание подчинной формы |
|
Замена ADODB.Recordset на New |
Option Explicit Function DataSql(dt_sql) DataSql = "#" & Format(dt_sql, "mm\/dd\/yy hh\:mm\:ss") & "#" End Function Function GetAccessConnect(FilePath As String) Dim sCon As String, strMyDBPassword As String Set GetAccessConnect = CreateObject("adodb.connection") strMyDBPassword = "642531" With GetAccessConnect .CursorLocation = 3 sCon = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" sCon = sCon & FilePath & ";Jet OLEDB:Database Password=" & strMyDBPassword & ";" .Open sCon End With End Function Sub test55() Set Cn = GetAccessConnect(ThisWorkbook.Path & "\data.accdb") Set Rs = CreateObject("ADODB.Recordset") End Sub Function GetRs(Cn, sstr) Set GetRs = CreateObject("ADODB.Recordset") GetRs.Open sstr, Cn, 3, 3 End Function
http://www.sql.ru/forum/1204869/zamena-adodb-recordset-na-new
|
Редактирование записи в форме после выполнения recordsetclone . Ошибка |
|
Импорт в Access по указанному условию |
http://www.sql.ru/forum/1204831/import-v-access-po-ukazannomu-usloviu
|
Запрос с сортировкой |
|
Проблема с завершением процесса Excel |
Public Sub Open_Click() Dim dlgOpenFile As Object Dim OTT As Variant Dim sFile As String Dim oXL As Excel.Application, oWB As Excel.Workbook, oWS As Excel.Worksheet Set oXL = CreateObject("Excel.Application") Set dlgOpenFile = Application.FileDialog(3) With dlgOpenFile .Filters.Add "Файлы Excel", "*.xls, *.xlsx, *.xlsb, *.xlsm", 1 .InitialFileName = CurrentProject.Path .AllowMultiSelect = False .Title = "Выберите файл" If (.Show = -1) And (.SelectedItems.Count > 0) Then sFile = .SelectedItems(1) End If End With Set dlgOpenFile = Nothing If sFile = "" Then Exit Sub End If Set oWB = oXL.Workbooks.Open(sFile) Set oWS = oWB.Sheets(1) OTT = oWS.Range(oWS.Cells(1, 1), oWS.Cells(500, 30)) Set oWS = Nothing oWB.Close Set oWB = Nothing oXL.Quit Set oXL = Nothing
http://www.sql.ru/forum/1204718/problema-s-zaversheniem-processa-excel
|
Ошибка синтаксиса |
Set cnRecordset = cn.Execute("Update dbo.DogovorPlan Set Year= " & Y & " ,kod_25='" & kod25 & "',kod_usluga='" & usluga & "',kod_urovuslug='" & urov & "',kod_12='" & kod12 & "',kod_52='" & kod_52 & "',kod_33='" & kod33 & " ', " _ & " kod_39='" & kod39 & "',kod_47='" & kod47 & "',kod_103='" & kod103 & "',kod_24='" & kod24 & "',kod_AFE='" & AFE & "',kod_Cdelka='" & cdelka & "',kod_StatBud='" & sbud & "',kod_edizm='" & edizm & "',cost='" & cost & "',coefficient='" & coef & "', " _ & " volume01 ='" & v01 & "',volume02='" & v02 & "',volume03='" & v03 & "',volume04='" & v04 & "',volume05='" & v05 & "',volume06='" & v06 & "',volume07='" & v07 & "',volume08='" & v08 & "',volume09='" & v09 & "',volume10='" & v10 & "',volume11='" & v11 & "', " _ & " volume12='" & v12 & "',sum01='" & s01 & "',sum02='" & s02 & "',sum03='" & s03 & "',sum04='" & s04 & "',sum05='" & s05 & "',sum06='" & s06 & "',sum07='" & s07 & "',sum08='" & s08 & "',sum09='" & s09 & "',sum10 ='" & s10 & "',sum11='" & s11 & "',sum12='" & s12 & "',totalVolume='" & totalv & "', " _ & " totalSum='" & totals & "',kod_kurator ='" & kurat & "',kod_manager='" & manag & "',type_activ='" & activ & "',Kod_18='" & kod18 & "',nameUslugi='" & nameUs & "',kod_upr='" & upr & "',kod_13='" & kod13 & "',recoverable='" & recover & "',numberLot='" & lot & "',ZKprotocol='" & zk & "',procNDS='" & nds & "', " _ & " NumDogKurator='" & dkur & "' , valuta='" & valuta & "' where dbo.DogovorPlan.idPlan='" & idp & "' ")
|
Это просто капец, я полный тормоз |
http://www.sql.ru/forum/1204684/eto-prosto-kapec-ya-polnyy-tormoz
|
Помогите с ф-цией отбора данных, задолбался! |
http://www.sql.ru/forum/1204679/pomogite-s-f-ciey-otbora-dannyh-zadolbalsya
|
Не работает DAO36 в mde Access 2010 |
http://www.sql.ru/forum/1204563/ne-rabotaet-dao36-v-mde-access-2010
|