- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
to connect to database through SQL
Hello
I would like to connect to the database through an SQL query.
I have written the JSL script
dt = Open Database (
"DRIVER = {SQL Server};
SERVER = HAISQLC162\HAISQLC162,3187
UID = hw_tests_viewer
PWD = ********
DATABASE = HW_Chip_Tests;"
,
"SELECT *
FROM [HW_Chip_Tests].[viewer].[chip_tests_row_data_3m_v]
where VID = 'S232NNC300578' "
);
but received error note: Data source name not found and no default driver specified
what I did wrong?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: to connect to database through SQL
To me it looks like the connection string is in wrong format. Usually they look like something like this
Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
how it exactly looks like depends on your database, your driver, settings on PC and so on.
You can also try to create the connection using JMPs query builder and extract the connection string from there (it will Use New SQL Query instead of Open Database which I would also suggest you use as that is the method which is supposed to be supported in the future of JMP). The connection string it creates will be a bit different as it might prefix it with ODBC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: to connect to database through SQL
To me it looks like the connection string is in wrong format. Usually they look like something like this
Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
how it exactly looks like depends on your database, your driver, settings on PC and so on.
You can also try to create the connection using JMPs query builder and extract the connection string from there (it will Use New SQL Query instead of Open Database which I would also suggest you use as that is the method which is supposed to be supported in the future of JMP). The connection string it creates will be a bit different as it might prefix it with ODBC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: to connect to database through SQL
Not sure if it's easier but you can also try File > Database > Open Table. You might need to create an ODBC user source. Once you open a table from SQL Server, you can find the connection string under the red or green triangle (depends on which version of JMP you are using).