Centralize credentials and make migration idempotent
- Move all DB credentials to config.asp with DSN/ODBC toggle - Add Zabbix API URL and token to centralized config - Update sql.asp, api.asp, apiusb.asp, zabbix.asp to use config - Add GetConnectionString() and GetEmployeeConnectionString() functions - Make migration SQL idempotent (safe to run multiple times) - Add duplicate index cleanup (appname_2) to migration - Document employee DB access limitation in CLAUDE.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,18 +1,9 @@
|
||||
<!--#include file="config.asp"-->
|
||||
<%
|
||||
' objConn - script-global connection object (no Dim for global scope)
|
||||
Session.Timeout=15
|
||||
Set objConn=Server.CreateObject("ADODB.Connection")
|
||||
' Old DSN connection:
|
||||
' objConn.ConnectionString="DSN=shopdb;Uid=root;Pwd=WJF11sql"
|
||||
' Direct MySQL ODBC connection with pooling enabled:
|
||||
objConn.ConnectionString="Driver={MySQL ODBC 9.4 Unicode Driver};" & _
|
||||
"Server=192.168.122.1;" & _
|
||||
"Port=3306;" & _
|
||||
"Database=shopdb;" & _
|
||||
"User=570005354;" & _
|
||||
"Password=570005354;" & _
|
||||
"Option=3;" & _
|
||||
"Pooling=True;Max Pool Size=100;"
|
||||
Session.Timeout = APP_SESSION_TIMEOUT
|
||||
Set objConn = Server.CreateObject("ADODB.Connection")
|
||||
objConn.ConnectionString = GetConnectionString()
|
||||
objConn.Open
|
||||
set rs = server.createobject("ADODB.Recordset")
|
||||
Set rs = Server.CreateObject("ADODB.Recordset")
|
||||
%>
|
||||
Reference in New Issue
Block a user