Search
 
SCRIPT & CODE EXAMPLE
 

SQL

wincc 7.4 to sql stackoverflow

Sub Create_new_table ()
Dim conn, rst, SQL_Table, name

On Error Resume Next

Set conn = CreateObject("ADODB.Connection")
Set rst = CreateObject("ADODB.Recordset")
name =Year(Date) & "_" & Month(Date) & "_" & Day(Date)
'Open data source - Datenquelle öffnen
conn.Open "Provider=MSDASQL;DSN=Database" 'DSN= Name of the ODBC database - DSN= Name der ODBC-Datenbank

'Error routine - Fehlerroutine
If Err.Number <> 0 Then
    ShowSystemAlarm "Error #" & Err.Number & " " & Err.Description
    Err.Clear
    Set conn = Nothing
    Exit Sub
End If


' FORMING TABLE
SQL_Table = "CREATE TABLE Paster_TT43_" & name & "(" &_
        "Signal NVARCHAR(30) ," &_
        "Date NVARCHAR(30) ," &_
        "Time NVARCHAR(30) ," &_
        "Value NVARCHAR(30)  )"
Set rst = conn.Execute(SQL_Table)

' There are more tables to create there is one for example
'Error routine - Fehlerroutine 
If Err.Number <> 0 Then
    ShowSystemAlarm "Error #" & Err.Number & " " & Err.Description
    Err.Clear
    'Close data source - Datenquelle schließen
    conn.close
    Set conn = Nothing
    Set rst = Nothing
    Exit Sub
End If

'Close data source - Datenquelle schließen
conn.close

Set rst = Nothing
Set conn = Nothing

End Sub
Comment

PREVIOUS NEXT
Code Example
Sql :: stored procedure to change name of column for all dependent tables and views 
Sql :: sqlalchemy one column of two has to be not null 
Sql :: select all domains of database firbird 
Sql :: https://www.jitendrazaa.com/blog/sql/sqlserver/export-documents-saved-as-blob-binary-from-sql-server/ 
Csharp :: unity next scene 
Csharp :: messagebox yes-no 
Csharp :: vb.net yes no cancel 
Csharp :: read text file to string c# 
Csharp :: c# random number between 1 and 100 
Csharp :: add only bottom border to container flutter 
Csharp :: unity key detection 
Csharp :: c# writeline debug 
Csharp :: asp.net core multiple get methods 
Csharp :: C# get pc language 
Csharp :: unity check if number is multiple of x 
Csharp :: c# center text 
Csharp :: unity foreach dictionary 
Csharp :: for loop unity 
Csharp :: base64 to image c# 
Csharp :: dotnet executable directory 
Csharp :: clear screen putty 
Csharp :: how to make a method wait in unity 
Csharp :: C# save pdf stream to file 
Csharp :: c# read json file into object 
Csharp :: c# print 
Csharp :: insert variables into string c# 
Csharp :: c# wpf keyinput DeadCharProcessed 
Csharp :: set textbox colour to transparent c# 
Csharp :: c# generate random int in range 
Csharp :: dynamics 365 update record c# 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =