ParserError

Archived support forum for customers who once purchased a PrimalForms product license. This forum is locked.
This topic is 12 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
smarshall
Posts: 9
Last visit: Mon Sep 05, 2022 6:05 pm

ParserError

Post by smarshall »

Can someone explain why I am getting a parse error on the SQL query in the code below? It runs fine from ISE.

Thanks
$OnLoadFormEvent={
#TODO: Initialize Form Controls here
param ([string]$server = "SERVER",[string]$instance = "DATABASE")

$AutoInstallQry = @"
SELECT v_AdvertisementInfo.ProgramName, v_AdvertisementInfo.AdvertisementID, v_AdvertisementInfo.PackageID, v_AdvertisementInfo.CollectionID,
v_AdvertisementInfo.PackageName, v_AdvertisementInfo.PackageVersion, v_AdvertisementInfo.CollectionName, v_Program.CommandLine,
SUBSTRING (SMSPackages.Source,23,LEN(SMSPackages.Source)-22) as SourceFolder
FROM v_AdvertisementInfo INNER JOIN
v_Program ON v_AdvertisementInfo.PackageID = v_Program.PackageID AND v_AdvertisementInfo.ProgramName = v_Program.ProgramName INNER JOIN
SMSPackages ON v_AdvertisementInfo.PackageID = SMSPackages.PkgID
WHERE (v_AdvertisementInfo.CollectionName = 'All Windows Workstation or Professional Systems') AND (NOT (v_Program.CommandLine LIKE ''))
"@
$connection = new-object system.data.sqlclient.sqlconnection("data Source=$server;Initial Catalog=$instance;Integrated Security=SSPI;
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

ParserError

Post by davidc »

What version of PrimalForms 2011 do you have installed? Please email zip and email the form file to support@sapien.com. We will take a look at the file to determine the problem. David
David
SAPIEN Technologies, Inc.
User avatar
smarshall
Posts: 9
Last visit: Mon Sep 05, 2022 6:05 pm

ParserError

Post by smarshall »

I updated to the latest version 2.0.16 this morning before starting the project. The email has been sent.

Thanks
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

ParserError

Post by davidc »

Found the problem in line 14: The "@ must be at the start of the line. Remove the extra tab and you should be fine.David
David
SAPIEN Technologies, Inc.
This topic is 12 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.