Hello there,
If anyone can help me with this, I can go home! (and I'd be eternally grateful of course)
In one table I have a list of fieldnames, with those fieldnames I've built an SQL string that looks something like this.
sqlstring = "SELECT " & str0 & str1 & ", SUM(" & str1b & "
AS SubTotal1 " & str2 & ", Sum(" & str2b & "
AS Subtotal2 " & str3 & ", Sum(" & str3b & "
AS Subtotal3 " & str4 & " FROM shaindata GROUP BY " & str0 & str1 & str2 & str3 & str4
All the str1-4 strings are lists of fieldnames made up of 2-byte Japanese kanji characters. When I display the string in a msgbox it appears to be OK, but when I try to open the recordset I get an error - something like "There aren't enough parameters, please designate 10" Or something... the OS is japanese so I can't do an exact translation. I've tried eliminating fields from the query to find the source but the only thing that changes is the number - ie. Please designate 4 etc.
Public Sub MakeReport()
On Error GoTo Err_MakeReport
Dim SQLs As String
SQLs = sqlstring
Dim db2 As DAO.Database
Dim rs2 As DAO.Recordset
Set db2 = CurrentDb()
Set rs2 = db2.OpenRecordset(SQLs)
' MsgBox SQLs, vbInformation, "SQLDebug"
rs2.Close
db2.Close
Exit_MakeReport:
Exit Sub
Err_MakeReport:
MsgBox Err.Description
Resume Exit_MakeReport
End Sub
Thanks in advance! Any advice gratefully received.
If anyone can help me with this, I can go home! (and I'd be eternally grateful of course)
In one table I have a list of fieldnames, with those fieldnames I've built an SQL string that looks something like this.
sqlstring = "SELECT " & str0 & str1 & ", SUM(" & str1b & "
All the str1-4 strings are lists of fieldnames made up of 2-byte Japanese kanji characters. When I display the string in a msgbox it appears to be OK, but when I try to open the recordset I get an error - something like "There aren't enough parameters, please designate 10" Or something... the OS is japanese so I can't do an exact translation. I've tried eliminating fields from the query to find the source but the only thing that changes is the number - ie. Please designate 4 etc.
Public Sub MakeReport()
On Error GoTo Err_MakeReport
Dim SQLs As String
SQLs = sqlstring
Dim db2 As DAO.Database
Dim rs2 As DAO.Recordset
Set db2 = CurrentDb()
Set rs2 = db2.OpenRecordset(SQLs)
' MsgBox SQLs, vbInformation, "SQLDebug"
rs2.Close
db2.Close
Exit_MakeReport:
Exit Sub
Err_MakeReport:
MsgBox Err.Description
Resume Exit_MakeReport
End Sub
Thanks in advance! Any advice gratefully received.