3/3/2025 3:01 PM | |
Joined: 9/12/2017 Last visit: 4/17/2025 Posts: 9 Rating:
|
Hi, I tried a lot of variations of the connectionstring, but I have no luck.. I am tracing the UCP and I get login timeout error.. . I can connect with the user from the SSMS. -I added an user in the windows administrative tools (name: test; pw:test) -I set the SQL Server and Windows Authentication mode -TCP/IP is enabled in the SQL Configuration Manager - Panel and PC are in the same subnet (panel: 192.168.200.2 [19.0.0.3 image]; PC: 192.168.200.200) - I created a database from the Management studio with "proba" name. The full code: (async function() { try{ let connectionstring = "DRIVER={ODBC Driver 18 for SQL Server}; DATABASE=proba; UID=test; PWD=test; trusted_connection=no; SERVER=192.168.200.200,1433; TrustServerCertificate=yes;"; let conn = await HMIRuntime.Database.CreateConnection(connectionstring); let query = "Create Table MyTable (ID int,Name varchar(50)); Insert into MyTable(ID ,Name) values (1,\"test\");"; let results = await conn.Execute(query); conn.Close(); } catch(e) { let res = e.Results; for(let statement in res) { let errors = res[statement].Errors; for (let i in errors) { let detailed = errors[i]; HMIRuntime.Trace("Errors state : "+detailed.State); HMIRuntime.Trace("Errors Message : "+detailed.Message); } } } })(); If I use Driver 17 I get the "file not found" error, which is ok, because I use 19.0.0.3 image. Where could I search the root of the login timeout error? Is my connectionstring wrong or maybe my SQL Server settings are wrong? ------------------------------------------------------------------------------------------ |
Last edited by: Moderator_Lan at: 03/03/2025 15:12:51New subject after splitting |
|
3/5/2025 12:28 PM | |
Joined: 9/12/2017 Last visit: 4/17/2025 Posts: 9 Rating:
|
Yes, I know. I use SQL Server authentication mode (login ID and PW). It is working with Management studio. |
3/5/2025 12:38 PM | |
Joined: 9/12/2017 Last visit: 4/17/2025 Posts: 9 Rating:
|
I attach what I see in the trace viewer |
3/5/2025 2:44 PM | |
Joined: 9/12/2017 Last visit: 4/17/2025 Posts: 9 Rating:
|
I created in the Administrative tools because I thought it is also neccessary, but it isn't. I also created an ODBC Data source with ODBC Driver 18 for SQL Server. I made some screenshots from my settings. Attachmentmssql_images.zip (14 Downloads) |
Follow us on