wincc 7 4 to sql stackoverflow

Solutions on MaxInterview for wincc 7 4 to sql stackoverflow by the best coders in the world

showing results for - "wincc 7 4 to sql stackoverflow"
Aliyah
11 Oct 2020
1Sub Create_new_table ()
2Dim conn, rst, SQL_Table, name
3
4On Error Resume Next
5
6Set conn = CreateObject("ADODB.Connection")
7Set rst = CreateObject("ADODB.Recordset")
8name =Year(Date) & "_" & Month(Date) & "_" & Day(Date)
9'Open data source - Datenquelle öffnen
10conn.Open "Provider=MSDASQL;DSN=Database" 'DSN= Name of the ODBC database - DSN= Name der ODBC-Datenbank
11
12'Error routine - Fehlerroutine
13If Err.Number <> 0 Then
14    ShowSystemAlarm "Error #" & Err.Number & " " & Err.Description
15    Err.Clear
16    Set conn = Nothing
17    Exit Sub
18End If
19
20
21' FORMING TABLE
22SQL_Table = "CREATE TABLE Paster_TT43_" & name & "(" &_
23        "Signal NVARCHAR(30) ," &_
24        "Date NVARCHAR(30) ," &_
25        "Time NVARCHAR(30) ," &_
26        "Value NVARCHAR(30)  )"
27Set rst = conn.Execute(SQL_Table)
28
29' There are more tables to create there is one for example
30'Error routine - Fehlerroutine 
31If Err.Number <> 0 Then
32    ShowSystemAlarm "Error #" & Err.Number & " " & Err.Description
33    Err.Clear
34    'Close data source - Datenquelle schließen
35    conn.close
36    Set conn = Nothing
37    Set rst = Nothing
38    Exit Sub
39End If
40
41'Close data source - Datenquelle schließen
42conn.close
43
44Set rst = Nothing
45Set conn = Nothing
46
47End Sub
48
similar questions
queries leading to this page
wincc 7 4 to sql stackoverflow