Answer the question
In order to leave comments, you need to log in
Why the error "The specified provider cannot be found. it is probably installed incorrectly?
Attribute VB_Name = "NewMacros"
Sub REPORT_FOR_COUNTING()
Dim Conn As New ADODB.Connection, Cmd As ADODB.Command, rsOra As ADODB.Recordset
Conn.Open "PROVIDER=OraOLEDB.Oracle.1;DATA SOURCE=SVBO;USER ID=ADMIN_ILLARION ;PASSWORD=M1l2w3"
Set Cmd = New ADODB.Command
Cmd.ActiveConnection = Conn
Cmd.CommandType = adCmdText
Set rsOra = New ADODB.Recordset
rsOra.CursorLocation = adUseServer
rsOra.Open "select POS_COUNT from REPORT_FOR_COUNTING where INST_ID='9001'", Conn, adOpenForwardOnly
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "GagraPos"
.Replacement.Text = rsOra.Fields.Item(0).Value
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection .Find.Execute
Selection.TypeText Text:=rsOra.Fields.Item(0).Value
rsOra.Close
End Sub
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question