日期:2014-05-17  浏览次数:20511 次

关于vs2003编译报错的问题

我的应用是vb.net

点击编译的时候,报错的文件是下面这个
Safety_menu.aspx.vb
报错的总结下来就是
sSQL和SQL_SUCCESS没有声明,
下面是关于这两段代码,不知道这东西在哪里声明,为什么编译的时候说没有声明?
VB.NET code

Public Class Safety_menu
    Inherits System.Web.UI.Page
    Protected WithEvents ImgMenuTitle As System.Web.UI.WebControls.Image
    Protected WithEvents lblMenuTitle As System.Web.UI.WebControls.Label
    Protected WithEvents spsData As FarPoint.Web.Spread.FpSpread
    Protected WithEvents Mn As System.Web.UI.HtmlControls.HtmlGenericControl
    Dim sMenuId As String
    Private strTabMn As String
    Protected ascPublic As ascPublic

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ascPublic = New ascPublic(Me)
        If Not Page.IsPostBack Then
            sMenuId = Request("MenuId")

            If Trim(sMenuId) = "" Then
                ImgMenuTitle.Visible = False
                lblMenuTitle.Visible = False
                lblMenuTitle.Text = ""
            Else
                ImgMenuTitle.Visible = True
                lblMenuTitle.Visible = True

                sSQL = ""
                sSQL = sSQL & " Select menu_name From CMT_MENU " & vbCrLf
                sSQL = sSQL & " Where menu_id = " & sMenuId


VB.NET code

            While ascPublic.RecordSet.Read
                If rv = SQL_SUCCESS Then




------解决方案--------------------
VB.NET code


Public Class Safety_menu
    Inherits System.Web.UI.Page
    Protected WithEvents ImgMenuTitle As System.Web.UI.WebControls.Image
    Protected WithEvents lblMenuTitle As System.Web.UI.WebControls.Label
    Protected WithEvents spsData As FarPoint.Web.Spread.FpSpread
    Protected WithEvents Mn As System.Web.UI.HtmlControls.HtmlGenericControl
    Dim sMenuId As String
    Private strTabMn As String
    Protected ascPublic As ascPublic

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ascPublic = New ascPublic(Me)
        If Not Page.IsPostBack Then
            sMenuId = Request("MenuId")

            If Trim(sMenuId) = "" Then
                ImgMenuTitle.Visible = False
                lblMenuTitle.Visible = False
                lblMenuTitle.Text = ""
            Else
                ImgMenuTitle.Visible = True
                lblMenuTitle.Visible = True
                Dim sSQL  As String
                sSQL = ""
                sSQL = sSQL & " Select menu_name From CMT_MENU " & vbCrLf
                sSQL = sSQL & " Where menu_id = " & sMenuId

------解决方案--------------------
Public Class Safety_menu
Inherits System.Web.UI.Page
Protected WithEvents ImgMenuTitle As System.Web.UI.WebControls.Image
Protected WithEvents lblMenuTitle As System.Web.UI.WebControls.Label
Protected WithEvents spsData As FarPoint.Web.Spread.FpSpread
Protected WithEvents Mn As System.Web.UI.HtmlControls.HtmlGenericControl
Dim sMenuId As String
'添加的 
Dim sSQL As String
Dim SQL_SUCCESS As String

Private strTabMn As String
Protected ascPublic As ascPublic

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ascPublic = New ascPublic(Me)
If Not Page.IsPostBack Then
sMenuId = Request("MenuId")

If Trim(sMenuId) = "" Then