Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 2enetworx TableEditor problem...
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

es4725
Junior Member

205 Posts

Posted - 26 February 2002 :  11:17:46  Show Profile
I'm trying to get table editor to work - but I'm having some problems getting it to function correctly. I'm not sure what all needs to be edited.

'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(2) = tedbSQLServer
'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) = "register.mdb;"

'For SQL Server
'arrDBs(i) = "DatabaseName;ComputerName;UserName;Password"
'arrDBs(2) = "Northwind;mark;sa; "

'For SQL Server
'arrDBs(i) = "DatabaseName;ComputerName;UserName;Password"
'arrDBs(2) = "HelpDeskVac;mark;bucklmar;bucklmar "

'For DSN
'arrDBs(i) = "DataSourceName"
'arrDBs(3) = "purple"

'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) = "Registration Database"
'arrDesc(2) = "SQL Server - Northwind"
'arrDesc(3) = "DSN - purple"
'arrDesc(4) = "Connection String"
'arrDesc(4) = "SQL Server - Northwinds"


That's the section that needs editing - I have one Access DB to use, and that's all. it's titled register.mdb. Anyone help?

GauravBhabu
Advanced Member

4288 Posts

Posted - 26 February 2002 :  11:31:13  Show Profile

'Define your total number of connections here
'(The biggest "i" of arrDBs(i) should be equal to this)
'const iTotalConnections = 4
const iTotalConnections = 1
'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) = "register.mdb;"

'For SQL Server
'arrDBs(i) = "DatabaseName;ComputerName;UserName;Password"
'arrDBs(2) = "Northwind;mark;sa; "

'For SQL Server
'arrDBs(i) = "DatabaseName;ComputerName;UserName;Password"
'arrDBs(2) = "HelpDeskVac;mark;bucklmar;bucklmar "

'For DSN
'arrDBs(i) = "DataSourceName"
'arrDBs(3) = "purple"

'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) = "Registration Database"

'arrDesc(2) = "SQL Server - Northwind"
'arrDesc(3) = "DSN - purple"
'arrDesc(4) = "Connection String"




www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.


Edited by - GauravBhabu on 26 February 2002 11:34:19
Go to Top of Page

es4725
Junior Member

205 Posts

Posted - 26 February 2002 :  12:00:13  Show Profile

arrType(0) = tedbAccess
arrType(1) = tedbAccess
arrType(2) = tedbSQLServer
arrType(3) = tedbDsn
'arrType(4) = tedbConnStr

[/quote]
I'm getting "Out of Range" errors here now.

Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 26 February 2002 :  12:31:12  Show Profile
comment out these statements

'arrType(2) = tedbSQLServer
'arrType(3) = tedbDsn
'arrType(4) = tedbConnStr

www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
Go to Top of Page

es4725
Junior Member

205 Posts

Posted - 26 February 2002 :  19:01:52  Show Profile
this is frustrating... still no go.
I now get the following error

Server.MapPath() error 'ASP 0173 : 80004005'

Invalid Path Character

/te_config.asp, line 135

An invalid character was specified in the Path parameter for the MapPath method.

Line 135 and a few lines below read:
 
arrConn(iConnection) = "Provider=Microsoft.Jet.OLEDB.4.0;" &_
"Persist Security Info=False;" &_
"Data Source=" & Server.MapPath(arrDBs(iConnection)) & ";" & _
"Jet OLEDB:Database Password=" & sPassword & ";"

So I'm not sure what the problem is...



Edited by - es4725 on 26 February 2002 19:03:52
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 26 February 2002 :  21:19:31  Show Profile
Try changing to this
 

select case arrType(iConnection)
case tedbAccess
'Access
aParams = split(arrDBs(iConnection), ";")
if isArray(aParams) then
sDBName = Server.MapPath(trim(aParams(0)))
'sDBName = trim(aParams(0))
sPassword = trim(aParams(1))
end if
arrConn(iConnection)= "Provider=Microsoft.Jet.OLEDB.4.0;" &_
"Persist Security Info=False;" &_
"Data Source=" & sDBName & ";" & _
"Jet OLEDB:Database Password=" & sPassword & ";"



www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Edited by - GauravBhabu on 26 February 2002 21:20:16
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 26 February 2002 :  21:29:46  Show Profile
Some of us just used the connection string from the Snitz Forums config.asp file.

«-------------------------------------------------»
Read the Do's and Don'ts before you post for help
«-------------------------------------------------»
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 26 February 2002 :  22:03:47  Show Profile
This is working code which I use, so should not be any problems.


www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
Go to Top of Page

es4725
Junior Member

205 Posts

Posted - 26 February 2002 :  22:56:32  Show Profile
quote:

Try changing to this
. . .



Worked like a charm... thanks.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.38 seconds. Powered By: Snitz Forums 2000 Version 3.4.07