vik999
10-06-2009, 09:44 AM
Hello i was wondering if someone could help me solve this becouse going insane with this stupid error. im getting this:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/oooo/home_page.asp, line 52, column 10
Dim fdCon As String = "Driver={MySQL ODBC 3.51 Driver};Server=serverIP;Database=DBname;user id=user;password=password;OPTION=3"
---------^
Code goes like this:
<%
Dim fdCon As String = "Driver={MySQL ODBC 3.51 Driver};Server=serverIP;Database=DBname;user id=user;password=password;OPTION=3"
Dim oConnection As System.Data.Odbc.OdbcConnection = New System.Data.Odbc.OdbcConnection(fdCon)
Dim fdCom As New System.Data.Odbc.OdbcCommand("SELECT * FROM news", oConnection)
oConnection.Open()
Dim objAdapter1 As New System.Data.Odbc.OdbcDataAdapter()
objAdapter1.SelectCommand = fdCom
Dim objDataset1 As New DataSet()
objAdapter1.Fill(objDataset1, "news")
GridView1.DataSource = objDataset1.Tables(0).DefaultView()
GridView1.DataBind()
oConnection.Close()
%>
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
now this does work on local server IIS when its in .aspx but fails if i try to put it in .asp .
any help of how i can make it work or what do i need to change in .asp file would be greatly appreciate :p
thnx in advance.
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/oooo/home_page.asp, line 52, column 10
Dim fdCon As String = "Driver={MySQL ODBC 3.51 Driver};Server=serverIP;Database=DBname;user id=user;password=password;OPTION=3"
---------^
Code goes like this:
<%
Dim fdCon As String = "Driver={MySQL ODBC 3.51 Driver};Server=serverIP;Database=DBname;user id=user;password=password;OPTION=3"
Dim oConnection As System.Data.Odbc.OdbcConnection = New System.Data.Odbc.OdbcConnection(fdCon)
Dim fdCom As New System.Data.Odbc.OdbcCommand("SELECT * FROM news", oConnection)
oConnection.Open()
Dim objAdapter1 As New System.Data.Odbc.OdbcDataAdapter()
objAdapter1.SelectCommand = fdCom
Dim objDataset1 As New DataSet()
objAdapter1.Fill(objDataset1, "news")
GridView1.DataSource = objDataset1.Tables(0).DefaultView()
GridView1.DataBind()
oConnection.Close()
%>
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
now this does work on local server IIS when its in .aspx but fails if i try to put it in .asp .
any help of how i can make it work or what do i need to change in .asp file would be greatly appreciate :p
thnx in advance.