Solved

syntax read help

Posted on 2006-11-28
6
311 Views
Last Modified: 2009-07-29
I am reading the code for this vb app and I came across this line..

 stSQL = "{native 'CALL WINS_SET_PARMS CurrentDate=" & cboMonth.Text & "/" & cboDay.Text & "/" & cboYear.Text & "'}"
 RunSQL(stSQL, stConn)


can someone interpret what the native call mean...?
0
Comment
Question by:zachvaldez
  • 2
  • 2
  • 2
6 Comments
 
LVL 35

Accepted Solution

by:
YZlat earned 125 total points
Comment Utility
>>stSQL = "{native 'CALL WINS_SET_PARMS CurrentDate=" & cboMonth.Text & "/" & cboDay.Text & "/" & cboYear.Text & "'}"

is a sql statement of some sort


 >>RunSQL(stSQL, stConn)

RunSQL is obviously some kind of function that takes two parameters: sql statement and database connection string and then executes sql statement against the database
0
 
LVL 35

Expert Comment

by:YZlat
Comment Utility
RunSQL could be implemented something like that in VB.NET:


Sub RunSQL(ByVal strConn As String, ByVal query As String)
        Dim conn as SqlConnection

        Try
            conn = New SqlConnection(strConn)
            conn.Open()
            Dim cmd As SqlCommand = New SqlCommand(query, conn)
            cmd.ExecuteNonQuery()
        Catch ex As SqlException
            Console.Write("SQL ERROR: " & ex.Message)
        Catch ex As Exception
            Console.Write("ERROR: " & ex.Message)
        Finally
              conn.Close()
        End Try
    End Sub


0
 
LVL 24

Expert Comment

by:Jeff Certain
Comment Utility
If I had to guess, I'd say it's a convoluted way of making a system call from the database to set the system date/time.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:zachvaldez
Comment Utility
Thanks, I understand the RUNSQL function, but what I dont get is the

"{native 'CALL WINS_SET_PARMS ....

This ia my first time to see this type use in a string
0
 
LVL 24

Expert Comment

by:Jeff Certain
Comment Utility
Again, it's probably a call to the system to set the date and time.
0
 

Author Comment

by:zachvaldez
Comment Utility
Is there  a need to use it or rather can a VB code handle it?
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now