syntax read help

Posted on 2006-11-28
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...?
Question by:zachvaldez
  • 2
  • 2
  • 2
LVL 35

Accepted Solution

YZlat earned 125 total points
ID: 18031613
>>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
LVL 35

Expert Comment

ID: 18031657
RunSQL could be implemented something like that in VB.NET:

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

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

LVL 24

Expert Comment

by:Jeff Certain
ID: 18032124
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.
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.


Author Comment

ID: 18034163
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
LVL 24

Expert Comment

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

Author Comment

ID: 18034627
Is there  a need to use it or rather can a VB code handle it?

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 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