Hvad er der galt hér?
Hej AlleJeg har problemer med et ASP script som opdaterer databaser...ved ikke om der er nogen der kender det. Det hedder TableEditor og er lavet af 2eNetWorX.
Nå, men altså, jeg kan ikke få skidtet til at virke...jeg får følgende fejlbesked fra browseren:
________________________
Server.MapPath() fejl \'ASP 0173 : 80004005\'
Ugyldigt tegn i sti
/te/te_config.asp, linje 128
Der blev angivet et ugyldigt tegn i parameteren sti for MapPath-metoden.
_____________________________
Koden fra filen ser således ud:
______________________________
<%
response.buffer = false
\'How many records in a page?
const cPerPage = 10
\'Encode HTML tags?
\'Turn this on if you have problems with displaying
\'records with html content.
const bEncodeHTML = False
\'Maximum number of chars to display in table view (0 : no limit)
\'Warning: If you have HTML content in your fields;
\'you should set bEncodeHTML to True if you specify a limit
const lMaxShowLen = 100
\'Show Related Table Contents as ComboBoxes for foreign key fields?
const Relation = True
\'Show connection details? (Number of tables, views and procs)
\'This requires all connections to be opened, so te_admin.asp will run slow
const bShowConnDetails = False
\'Should blank fields be converted to NULL when the field is nullable?
\'Convert \'\' to null in non-numeric and non-date fields?
Const bConvertNull = False
\'Convert \'\' and 0 to null in numeric fields?
Const bConvertNumericNull = False
\'Convert \'\' and 0 to null in date fields?
Const bConvertDateNull = False
\'Define your total number of connections here
\'(The biggest \"i\" of arrDBs(i) should be equal to this)
const iTotalConnections = 4
\'Using Redim causes a performance degredation
\'But it\'s OK since array size is small
redim arrDbs(iTotalConnections)
redim arrDesc(iTotalConnections)
redim arrType(iTotalConnections)
redim arrConn(iTotalConnections)
\'Different Connection Types
const tedbAccess = 1
const tedbSQLServer = 2
const tedbDsn = 3
const tedbConnStr = 4
arrType(0) = tedbAccess
arrType(1) = tedbAccess
arrType(2) = tedbSQLServer
arrType(3) = tedbDsn
arrType(4) = tedbConnStr
\'--[»]--- Define database locations -------------------------
arrDBs(0) = \"teadmin.mdb;\" \'TableEditoR user administration db
\'For Access (password is optional)
\'arrDBs(i) = \"DatabasePath\\DatabaseName.mdb;[Password]\"
arrDBs(1) = \"test.mdb; \"
\'For SQL Server
\'arrDBs(i) = \"DatabaseName;ComputerName;UserName;Password\"
arrDBs(2) = \"northwind;192.168.0.1;sa; \"
\'For DSN
\'arrDBs(i) = \"DataSourceName\"
arrDBs(3) = \"testdsn\"
\'For direct Connection String
\'arrDBs(i) = \"AnyConnectionString\"
arrDBs(4) = \"Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=\" & Server.MapPath(\"test.mdb\") & \";\"
\'--[»]--- Define Descriptions for Connections ---------------
arrDesc(0) = \"Table Editor User Administration\"
arrDesc(1) = \"Access - test.mdb\"
arrDesc(2) = \"SQL Server - Nortwind\"
arrDesc(3) = \"DSN - TestDsn\"
arrDesc(4) = \"Connection String\"
\'That\'s all ;)
\'Construct connection strings
for iConnection = 0 to iTotalConnections
sDBName = \"\"
sComputerName = \"\"
sUserName = \"\"
sPassword = \"\"
\'response.write arrDBs(iConnection) & \"<br>\"
select case arrType(iConnection)
case tedbAccess
\'Access
aParams = split(arrDBs(iConnection), \";\")
if isArray(aParams) then
sDBName = Server.MapPath(trim(aParams(0)))
sPassword = trim(aParams(1))
end if
arrConn(iConnection) = \"Provider=Microsoft.Jet.OLEDB.4.0;\" &_
\"Persist Security Info=False;\" &_
\"Data Source=\" & Server.MapPath(arrDBs(iConnection)) & \";\" & _
\"Jet OLEDB:Database Password=\" & sPassword & \";\"
case tedbSQLServer
\'SQL Server
aParams = split(arrDBs(iConnection), \";\")
if isArray(aParams) then
sDBName = trim(aParams(0))
sComputerName = trim(aParams(1))
sUserName = trim(aParams(2))
sPassword = trim(aParams(3))
end if
arrConn(iConnection) = \"Provider=SqlOLEDB;Network Library=DBMSSOCN;\" & _
\"Data Source=\" & sComputerNAme & \";\" &_
\"Initial Catalog=\" & sDBName & \";\" & _
\"User Id=\" & sUserName & \";\" &_
\"Password=\" & sPassword & \";\"
case tedbDsn
\'Data Source Name
arrConn(iConnection) = \"dsn=\" & arrDBs(iConnection)
case tedbConnStr
\'Direct connection string
arrConn(iConnection) = arrDBs(iConnection)
end select
next
%>
_________________________
Jeg kan ikke se, hvor fejlen...håber der er andre der kan :o)
/Peter
