UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Expect End Of Statement Error, Any Versions    
 
   
ordnance1
post Jan 12 2019, 02:56 AM
Post#1



Posts: 583
Joined: 7-May 11



Clearly I am out of my depth, but I need to create an SQL server connection string to use in a MS Access module. But i get a compile error Expect end of statement and RTIMO135528 is highlighted.

CODE
stConnect = "Provider=SQLNCLI10;Data Source=" & RTIMO135528 & ";Initial Catalog=" & Eagles22 & ";Integrated Security=SSPI;"


CODE
Option Compare Database
Private Const stConnect = "Provider=SQLNCLI10;Data Source=" &amp RTIMO135528 & ";Initial Catalog=" & Eagles22 & ";Integrated Security=SSPI;"
Sub Update_AttendanceCount_FiscalYear()   'Runs the SQL Server stored procedure to get the count of attendance for each date
    'This is used to set the calendar daet colors
    'o = non meeting date
    '1 = meetig date with no attedance
    '2 = meeting date with 1 or more attendees
    '3 = Holiday
        Dim cmd As ADODB.Command
        Set cmd = New ADODB.Command

        Dim rst As ADODB.Recordset

        With cmd
            .ActiveConnection = ConnectString
            .CommandText = "spAttendanceCount_FiscalYear"
            .CommandType = adCmdStoredProc
            .Parameters.Append .CreateParameter("@FiscalYear", adInteger, adParamInput, 4, TempVars!Year)
            Set rst = .Execute
        End With

        Set rst = Nothing
        Set cmd = Nothing
    
End Sub
Go to the top of the page
 
GroverParkGeorge
post Jan 12 2019, 08:00 AM
Post#2


UA Admin
Posts: 34,298
Joined: 20-June 02
From: Newcastle, WA


what is this:

Data Source=" &amp RTIMO135528 &

Why does this segment include &amp in it?

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
ordnance1
post Jan 12 2019, 02:25 PM
Post#3



Posts: 583
Joined: 7-May 11



Thank you for the reply. As i mentioned this was over my head so had based that on what I found on google. Your prompt set me in the right direction and I have it working now.
Go to the top of the page
 
GroverParkGeorge
post Jan 13 2019, 09:04 AM
Post#4


UA Admin
Posts: 34,298
Joined: 20-June 02
From: Newcastle, WA


Congratulations on identifying and resolving the problem.

Continued success with the project.

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    16th January 2019 - 07:21 AM