HI,
I have database on local machine which I am trying to sync .
localhost\sqlexpress
database - items
username- xx | password xxx
table - quickcapture
primarykey - recordid
column to sync - Task
This is 100% working connection string , tested via powershell
$connectionString = "Server=localhost\SQLEXPRESS;Database=items;User ID=xx;Password=xxx;Trusted_Connection=False"
$connection = New-Object System.Data.SqlClient.SqlConnection $connectionStringtry {
$connection.Open()
Write-Output "Connection successful!"
}
catch {
Write-Output "Connection failed: $($_.Exception.Message)"
}
finally {
$connection.Close()
}
- I tried the following script below , but when i try to run with below I get the error 1 fields found for mapping but database connection OK but sql query failed
- Sometimes I get the errro recordid field not found in databaes , I can 100% confrim I have created a custom field (text) for the same
- SELECT recordid, Task AS Item FROM dbo.quickcapture -> This 100% confirm works
<ConnectionString>PROVIDER=MSOLEDBSQL;PASSWORD=xxx;PERSIST SECURITY INFO=TRUE;USER ID=xx;INITIAL CATALOG=items;DATA SOURCE=localhost\SQLEXPRESS;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096</ConnectionString>
<FieldMap>
[recordid] recordid
[Task] Item
</FieldMap>
<Source>
SELECT recordid, Task AS Item FROM dbo.quickcapture
</Source>
<RecordIDField>recordid</RecordIDField>
<RecordStatus>IDStatusSQL ADD UPDATE</RecordStatus>
Comments
Hi, Did you try removing…
Hi,
HTH!
Hi, I modified the sql table…
Hi,
I modified the sql table to have only two records now recordid,item now
1 field found for mapping. RecordID field not found (recordid is not a filed in your IQBase).
I think the error is arising from <RecordIDField>recordid</RecordIDField>
when I do
I think the error is arising from <RecordIDField>IDSQL</RecordIDField> i get same error as above
so do you have in your…
so do you have in your IQBase a numeric field named recordid?
I had a text field named…
I had a text field named recordid , which I change to numeric but same result. aka recordid not found
but sometimes I get different error
1 field found for mapping. Database conneciton OK but sql query failed. Parsed will open. TempSQLCommand text file opens with below commmand 1 field found for mapping.
SELECT recordid,item FROM quickcapture --> This commands works fine when testing
Can you share the server…
Can you share the server database structure ? (aka field list)
(I thought the server field was named Task... so SELECT Item would of course fail, as this field does not exist on the server)
I had modified the sql table…
I had modified the sql table to better simplify the query but regarless schema is simple
table name - quickcapture , only two columns . Microsoft SQL 2019 , database - items
item - nvarchar(max)
do let me know if I need to…
do let me know if I need to post or change something