📄 conncre.ssc
字号:
<!--SCRIPT PSOBJMOD
import( site.GetRootDocument().location + "/ObjMod80.ssc" );
session.active = true;
InitObjects(session);
-->
<!--SCRIPT // {{ SCRIPT()
/* Create a connection */
function writeNullableField( field )
{
if( field != null ) {
return( '"' + field + '"' );
} else {
return( '""' );
}
}
function moreFields( index )
{
var conn = session[index];
return( conn.userId != null
|| conn.password != null
|| conn.connectionType != null
|| conn.database != null
|| conn.connectionParameters != null );
}
var webRoot = site.GetRootDocument();
import ( webRoot.location + '/system/utils/strtable.ssc' );
var text;
var path;
var doc;
if( session != null ) {
var i;
text = "<!--SCRIPT\r\n";
text += IntlStr.scriptGenerated;
text += "function LoadConnections() {\r\n";
for( i in session ) {
text += 'site.LoadConnection( "' + session[i].name + '", "';
text += session[i].description;
text += '", "' + session[i].dataSource + '"';
// if the rest of the parameters are empty, skip them
if( moreFields( i ) ) {
text += ', ' + writeNullableField( session[i].userId );
text += ', ' + writeNullableField( session[i].password );
text += ', ' + writeNullableField( session[i].connectionType );
if( session[i].connectionType == "ODBC" ) {
text += ', ' + writeNullableField( session[i].connectionParameters );
} else {
text += ', ' + writeNullableField( session[i].database );
}
}
text += ' );\r\n';
}
text += '}\r\n--' + '>\r\n';
}
path = document.location + '/connect.ssc';
doc = site.GetDocument( path );
if( doc == null ) {
site.CreateDocument( path, 'script', '', text );
} else {
doc.source = text;
}
// }}
-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -