I am trying to retrieve some info from a csv file by doing a request to it but I keep having this error: No value given for one or more required parameters, Code 80040E10 Source: Microsoft JET Database Engine
It concerns the following line of my script:
RECORDSET.Open "SELECT * FROM " & strFile & " WHERE ComputerName = '" & OldComputerName & "'", CONNECTION, 3, 3
But if I do a wscript.echo of the strFile and OldComputerName right before the request, they display the right values.
Here is the whole part of the script with the request:
dim CONNECTION : set CONNECTION = CreateObject("ADODB.CONNECTION")
dim RECORDSET : set RECORDSET = CreateObject("ADODB.RECORDSET")
CONNECTION.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\contoso.scom\DP_IT\Rollout\;Extended Properties=""text;HDR=YES;FMT=Delimited"""
strFile = "[CONTOSO-OPR-ComputerList.csv]"
wscript.echo strfile
wscript.echo OldComputerNameenter
RECORDSET.Open "SELECT * FROM " & strFile & " WHERE ComputerName = '" & OldComputerName & "'", CONNECTION, 3, 3
I would like to tell that this worked before. I haven't touch it for some weeks but it appears that something has changed and I don't know what :/
EDIT: If I do a wscript.echo of the entire request it gives me this:
SELECT * FROM [CONTOSO-OPR-ComputerList.csv] WHERE ComputerName = 'ABC123'