6/30/2018 5:15 PM | |
Posts: 1 Rating:
|
Hi all, I had already seen this project https://support.industry.siemens.com/cs/cn/en/view/61883659 But in my case, i already had a database and a table in sql server management. I want to add them into vb script without using tag. Tks a lot |
Last edited by: Jen_Moderator at: 7/2/2018 12:09:58 PMOptimized link. |
|
8/15/2018 7:53 AM | |
Posts: 1 Rating:
|
Hi tamdang! I suggest you to read about ADODB since that is the VBScript way of connecting to databases and I have used it without problem (as long as I write correct code
If i'd like to fetch some data I use this:
I also almost always use error checking after opening and executing the connections and queries:
For the error check to work as intended you need this as the first line of code:
Some links to resources I have used when programming the database connection: VBScript ADO Programming @ Microsoft Docs ADO Introduction @ w3schools.com Connection Strings For SQL Server @ ConnectionStrings.com The connection strings use different drivers but I always try to use the ODBC drivers (like the {SQL Server} my example connection strings). To check which versions you have installed you can use this guide Check The ODBC SQL Server Driver Version (Windows) @ Microsoft Docs Hope this helps you and other beginners in connection to an SQL Server and manipulate data in it. Ymer |
Follow us on