I'll start by saying I'm just beginning to work SQL Databases. I am trying to use ADOSQL.ahk to manipulate a database I setup. I installed Microsoft SQL Server 2019 and Microsoft SQL Server Management Studio 18, connected using my Window's credentials and created a new Database, Table, some Columns, and some Values. I then added a new Login for the database. I have scoured the forums already and after trying and trying I'm finally reaching out. Below is the code I'm using, and slightly modifying the code I run into a couple different errors but it seems the farthest I can get is the error here.
Code: Select all
#NoEnv
#Include adosql.ahk
#SingleInstance,Force
rs := object()
connection_String := "Provider=MSOLEDBSQL19;Password=snake;Persist Security Info=True;User ID=sa;Initial Catalog=rockinfo;Data Source=<ComputerName>;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=False"
sql_query := "insert into minerals (Type, Shape) values ('Diamond', 'Princess');"
try
rs := ADOSQL( connection_string, sql_query ) ;
catch
MsgBox, Failed
MsgBox, Query = %ADOSQL_LastQuery%`nError = %ADOSQL_LastError%
Return
- image.png (7.35 KiB) Viewed 9703 times
I'm stumped, I've tried so many different things I can't figure out where to go from here.