| | |
Is there anything wrong with this code
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2005
Posts: 27
Reputation:
Solved Threads: 0
<html>
<head>
<title></title>
</head>
<body>
<%
Function NewConn()
Set NewConn= Server.CreateObject("ADODB.Connection")
NewConn.ConnectionTimeout=100
NewConn.Open "Provider=sqloledb;Data Source=[192.168.160.1];uid=[sa ];pwd=[topland]"
NewConn.CommandTimeout=1200
End Function
%>
</body>
</html>
I am trying this functions.inc code then use the include ext and i keep on getting this error message
Error Type:
Active Server Pages, ASP 0126 (0x80004005)
The include file 'functions.inc' was not found.
/Assets.asp, line 1
and when i try to save it as functions.inc.asp i get this
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/Staff.asp, line 14, column 37
i am relly stuck and have been going around for days nows can anyone please help.
<head>
<title></title>
</head>
<body>
<%
Function NewConn()
Set NewConn= Server.CreateObject("ADODB.Connection")
NewConn.ConnectionTimeout=100
NewConn.Open "Provider=sqloledb;Data Source=[192.168.160.1];uid=[sa ];pwd=[topland]"
NewConn.CommandTimeout=1200
End Function
%>
</body>
</html>
I am trying this functions.inc code then use the include ext and i keep on getting this error message
Error Type:
Active Server Pages, ASP 0126 (0x80004005)
The include file 'functions.inc' was not found.
/Assets.asp, line 1
and when i try to save it as functions.inc.asp i get this
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/Staff.asp, line 14, column 37
i am relly stuck and have been going around for days nows can anyone please help.
•
•
Join Date: Jun 2005
Posts: 107
Reputation:
Solved Threads: 3
To include reusable code from a file you do smth like
functions.inc:
And then in the file where you want to insert the 'functions.inc' (the file should have the '.asp' extension)
eg. index.asp:
functions.inc:
ASP Syntax (Toggle Plain Text)
Function NewConn() Set NewConn= Server.CreateObject("ADODB.Connection") NewConn.ConnectionTimeout=100 NewConn.Open "Provider=sqloledb;Data Source=[192.168.160.1];uid=[sa ];pwd=[topland]" NewConn.CommandTimeout=1200 End Function
And then in the file where you want to insert the 'functions.inc' (the file should have the '.asp' extension)
eg. index.asp:
ASP Syntax (Toggle Plain Text)
<HTML> <BODY> blahblah <!--#include file="functions.inc"--> <% more blah blah %> </BODY> </HTML>
![]() |
Similar Threads
- Can anyone figure out what is wrong in my program? (C++)
- What did I do wrong? (C++)
- Need help! With changing an equation into code and file opening (C++)
- Please help with login page code behind (ASP.NET)
- please help me!!been trying to trace where ive gone wrong!!! (C)
- Script stores data in wrong MySQL columns (MySQL)
- wrong output (C++)
- What is wrong wtih my css? (JavaScript / DHTML / AJAX)
- merged:nesting loops (C++)
Other Threads in the ASP Forum
- Previous Thread: wat is web.config
- Next Thread: how to retrieve textfield for more than 1 checked records?
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection calendar changeable connection current database databaseconnection diagnostics dreamweaver excel fso html iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit web webserver windows7





