File: admin_lt_wiz.vsp

package info (click to toggle)
virtuoso-opensource 6.1.6+dfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 260,992 kB
  • ctags: 125,220
  • sloc: ansic: 652,748; sql: 458,419; xml: 282,834; java: 61,031; sh: 40,031; cpp: 36,890; cs: 25,240; php: 12,692; yacc: 9,523; lex: 7,018; makefile: 6,157; jsp: 4,484; awk: 1,643; perl: 1,013; ruby: 1,003; python: 326
file content (727 lines) | stat: -rw-r--r-- 23,758 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
<?vsp 
--  
--  $Id$
--  
--  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
--  project.
--  
--  Copyright (C) 1998-2012 OpenLink Software
--  
--  This project is free software; you can redistribute it and/or modify it
--  under the terms of the GNU General Public License as published by the
--  Free Software Foundation; only version 2 of the License, dated June 1991.
--  
--  This program is distributed in the hope that it will be useful, but
--  WITHOUT ANY WARRANTY; without even the implied warranty of
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
--  General Public License for more details.
--  
--  You should have received a copy of the GNU General Public License along
--  with this program; if not, write to the Free Software Foundation, Inc.,
--  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--  
--  
?>

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">

<?vsp
--no_c_escapes-
  declare _spagein varchar;
  declare _spage integer;
  declare _town varchar;
  declare _tdsn varchar;
  declare _rows integer;
  declare _tablelist varchar;
  declare _tpwd varchar;
  declare _pwd varchar;
  declare _tqual varchar;
  declare _sql varchar;
  declare _reswin integer;
  declare _cmd varchar;
  declare _dsn varchar;
  declare _tuid varchar;
  declare _uid varchar;
  declare _fontsize varchar;

  declare _table varchar;
  declare _frame varchar;
  declare _justvirt integer;

  declare m_dta, m_dta_col, result any;
  declare err_sqlstate, err_msg varchar;

  if (not adm_check_auth (lines))
    return (0);

--  dbg_obj_print(path);
--  dbg_obj_print (params);
--  dbg_obj_print(lines);


  _spagein := get_keyword ('spage', params, '');
if (_spagein='')
{
?>
<html><head><title>Wizard</title>
<SCRIPT Language="JavaScript">
<!--
function WinOpen(wURL, wName, wWidth, wHeight){
  return window.open(wURL,wName,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=" + wWidth + ",height=" + wHeight)
}
function startwizard() {
    WinOpen("/admin/admin_lt_wiz.vsp?spage=1", "wizard", "476", "360");
    history.go(-1);
}
startwizard();
 -->
 </SCRIPT>
<body>
<hr>
Your browser does not support Javascript which is required for the Wizard.<br>
Please use alternative menu options.
</body></html>
<?vsp
return;
}
  _spage := atoi(_spagein);
  _fontsize := get_keyword ('fontsize', params, '2');
  _town := get_keyword ('town', params, '');
  _tdsn := get_keyword ('tdsn', params, '');
  _rows := atoi(get_keyword ('rows', params, '100'));
  _tablelist := get_keyword ('tablelist', params, '');
  _tpwd := get_keyword ('tpwd', params, '');
  _pwd := get_keyword ('pwd', params, '');
  _tqual := get_keyword ('tqual', params, '');
  _sql := replace(get_keyword ('sql', params, ''),'\n',' ');
  _reswin := adm_is_checked ('reswin', params, '');
  _cmd := trim(replace(get_keyword ('cmd', params, ''),'+',''));
  _dsn := get_keyword ('dsn', params, '');
  if (ascii(_dsn)=33) {
    _dsn:=subseq(_dsn,1);
  }
  _tuid := get_keyword ('tuid', params, '');
  _uid := get_keyword ('uid', params, 'dba');

  _table := get_keyword ('table', params, '');
  _frame := get_keyword ('frame', params, '');
  _justvirt := adm_is_checked ('justvirt', params);

  _spage := nextpage(_spage,params);
  dbg_printf ('newpage %d; cmd=\'%s\'',_spage,_cmd);

  if (_spage=1) {
?>

<head><title>Virtuoso External Table Linking Wizard (ODBC)</title>
<SCRIPT Language="JavaScript">
function candolink(thisform) {
    i = thisform.dsn.selectedIndex;
    if (i > 0) {
	return true;
    } else {
	alert("Select a DSN to link with.");
	return false;
    }
}
function candolist(thisform) {
    i = thisform.dsn.selectedIndex;
    if (i < 1) {
	alert("Select a DSN to use for the list.");
	return false;
    }
    dsn=thisform.dsn.options[i].value;
    if (dsn.charAt(0)!="!") {
	alert("You can only list tables on a Virtuoso DSN.");
	return false;
    }
    return true;
}
function candoisql(thisform) {
    i = thisform.dsn.selectedIndex;
    if (i > 0) {
	return true;
    } else {
	alert("Select a DSN to run the SQL against");
	return false;
    }
}
function togglevirt(thisform) {
thisform.next.value='Main';
thisform.submit();
}
function focusonload() {
}
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.1">
function focusonload() {
self.focus()
}
</SCRIPT>
</head>
<body bgcolor="#C0C0C0" onload="focusonload()">
<center><font size=4>Virtuoso External Table Linking Wizard (ODBC)</font></center>

<?include adm_js_check.vsp ?>
<FORM name='dsnlist' method="POST" action='/admin/admin_lt_wiz.vsp'>
<table border="0" width="100%" valign="top">
<tr>
<td width="300">
<SELECT SIZE="13" NAME="dsn">
<SCRIPT LANGUAGE="JavaScript">
if (navigator.appName != "Netscape")
    document.write("<OPTION>Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Comment:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
else
{
  if (parseFloat(navigator.appVersion) >= 4)
    document.write("<OPTION>Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Comment:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  else
    document.write("<OPTION>Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Comment:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
}
</SCRIPT>
<?vsp adm_lt_dsn_options('',_justvirt); ?>
</SELECT>
</td>
<td valign="top">
<table border="0" align="left">
<input type="hidden" name="spage" value=1>
<input type="hidden" name="next" value="Next >">
<SCRIPT LANGUAGE="JavaScript">
if (navigator.appName == "Netscape" && (parseFloat(navigator.appVersion) >= 4)) {
    document.write("<tr><td><INPUT Type=\"submit\" name=cmd width=\"82\" Value=\"Link\" onclick='return candolink(this.form)'></td></tr>");
    document.write("<tr><td><INPUT Type=\"submit\" name=cmd width=\"82\" Value=\"List\" onclick='return candolist(this.form)'></td></tr>");
    document.write("<tr><td><INPUT Type=\"submit\" name=cmd width=\"82\" Value=\"ISQL\" onclick='return candoisql(this.form)'></td></tr>");
} else {
    document.write("<tr><td><INPUT Type=\"submit\" name=cmd Value=\"  Link    \" onclick='return candolink(this.form)'></td></tr>");
    document.write("<tr><td><INPUT Type=\"submit\" name=cmd Value=\"   List    \" onclick='return candolist(this.form)' onmouseover=\"dls('simple left<br>line 2<br>line3'); return true;\"></td></tr>");
    document.write("<tr><td><INPUT Type=\"submit\" name=cmd Value=\"  ISQL  \" onclick='return candoisql(this.form)'></td></tr>");
}
</script>
<tr><td>
<INPUT TYPE=CHECKBOX NAME="justvirt" onclick='togglevirt(this.form)'
<?vsp
if (_justvirt) http(' CHECKED');
?>
>Just<br>Virtuoso</td></tr>
</table>
</td>
</tr>
<tr>

<td colspan="2"><img src="/images/virtv.gif" align=left>
<FONT SIZE="2">
&nbsp;Select a DSN, and then an action Button.
</FONT></td>
</tr>
<tr><td colspan="2" align="right"><a href="javascript:self.close()">
<img src="/images/exit.gif" border="0"></a></td></tr>
</table>
</form>
<DIV id=overDiv style="POSITION: absolute"></DIV>
<SCRIPT SRC="popuphlp.js"></SCRIPT>
</body>
<?vsp
return;
}

if (_spage=2)
{

?>
<head><title>Connect details for <?=_cmd?></title></head>
<body bgcolor="#C0C0C0">
<form method="POST" name='page2' action='/admin/admin_lt_wiz.vsp'>
<input type="hidden" name="spage" value=2>
<input type="hidden" name="town" value="<?=_town?>">
<input type="hidden" name="tdsn" value="<?=_tdsn?>">
<input type="hidden" name="rows" value="<?=_rows?>">
<input type="hidden" name="tablelist" value="<?=_tablelist?>">
<input type="hidden" name="tpwd" value="<?=_tpwd?>">
<input type="hidden" name="tqual" value="<?=_tqual?>">
<input type="hidden" name="sql" value="<?=_sql?>">
<input type="hidden" name="reswin" value="<?=_reswin?>">
<input type="hidden" name="fontsize" value="<?=_fontsize?>">
<input type="hidden" name="cmd" value="<?=_cmd?>">
<input type="hidden" name="dsn" value="<?=_dsn?>">
<input type="hidden" name="tuid" value="<?=_tuid?>">
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr>
<td rowspan="5" width=120><img src="/images/vdlgbox.jpg" border="0"></td>
<td colspan="2"><font size="2">Enter the connect details to access the DSN called<br>
<?=_dsn?>:</font></td>
</tr>
<tr>
<td><font size="2">User Name:</font></td><td><INPUT TYPE=TEXT NAME=uid SIZE=30 MAXLENGTH=30 VALUE="<?=_uid?>" tabindex=1></td>
</tr>
<tr><td colspan=2 valign=top><font size="2">The username for this connection.</font></td></tr>
<tr>
<td><font size="2">Password:</font></td><td><INPUT TYPE=password NAME=pwd SIZE=30 VALUE="<?=_pwd?>" tabindex=2></td>
</tr>
<tr><td colspan=2 valign=top><font size="2">The password for this connection.</font></td></tr>
<tr>
<td colspan=3 align=right><br>
<input type="submit" name="prev" value="< Back" tabindex=4>&nbsp;
<input type="submit" name="next" value="Next >" tabindex=3>&nbsp;
<input type="submit" name="next" value=" Main " tabindex=5>&nbsp;
<input type="button" name="exit" value="  Exit   " onclick="self.close()" tabindex=6>
</td>
</tr>
</table>
</form>
</body>

<?vsp

return;
}
if (_spage=3 AND _frame='' AND (_cmd='List' OR _cmd='Link'))
{

?>

<HTML><HEAD><TITLE>
<?vsp
if (_cmd='Link')
  http(_cmd);
else
  http('Unlink');
?>
Table List</TITLE>
</HEAD>
<FRAMESET ROWS="60,*,40">
  <FRAME NAME="listtop" SRC="/admin/admin_lt_wiz.vsp?dsn=<?/_dsn?>&spage=3&cmd=<?/_cmd?>&frame=top" SCROLLING="no" FRAMEBORDER="0" NORESIZE>
  <FRAME NAME="listmain" SRC="/admin/admin_lt_wiz.vsp?dsn=<?/_dsn?>&spage=3&cmd=<?/_cmd?>&uid=<?/_uid?>&pwd=<?/_pwd?>&frame=tbllst" SCROLLING="auto" FRAMEBORDER="0" NORESIZE>
  <FRAME NAME="listfoot" SRC="/admin/admin_lt_wiz.vsp?dsn=<?/_dsn?>&spage=3&cmd=<?/_cmd?>&frame=foot" SCROLLING="no" FRAMEBORDER="0" NORESIZE MARGINHEIGHT="4" MARGINWIDTH="6">
</FRAMESET>

<?vsp
return;
}

if ('top' = _frame)
{
  if (_cmd='List') { _cmd:='Unlink'; }
?>
<html><body bgcolor="#C0C0C0">
<font size=3><b><?=_cmd?> tables from <?=_dsn?></b></font><br>
<font size=2>Select the tables you wish to <?=_cmd?> then press "Next".</font>
</body></html>

<?vsp
return;
}

if ('tbllst' = _frame AND _cmd='Link')
{
?>
<!-- table selection -->

<html><head><title>Link Table List</title>
<SCRIPT Language="JavaScript">
function checklink(thisform) {<?vsp
declare numtables integer;
declare tables any;
  vd_remote_data_source (_dsn, '', _uid, _pwd);
  if (sys_stat ('vdb_attach_autocommit') > 0) vd_autocommit (_dsn, 1);
  tables := sql_tables (_dsn, NULL, '%', '%', 'TABLE');
numtables:=length(tables);
-- dbg_obj_print(numtables);
if (numtables=0) http('alert("There are no tables to link");return false;');
if (numtables=1) http('if (thisform.tablelist.checked) { return true }');
if (numtables>1) {
?>
  for (var i=0; i < thisform.tablelist.length; i++) {
    if (thisform.tablelist[i].checked) { return true }
  }
  alert("Choose at least one table");
  return false;
<?vsp
 }
?>
}
</SCRIPT></head>
<body bgcolor="#C0C0C0">
  <FORM METHOD=POST action="admin_lt_wiz.vsp" target="_top" name=form>
    <TABLE BORDER=1 NOWRAP WIDTH=99%>
      <TR>
        <TH ALIGN=CENTER><font size=2>Link</font></TH><TH ALIGN=LEFT><font size=2>Qual.</font></TH><TH ALIGN=LEFT><font size=2>Owner</font></TH>
        <TH ALIGN=LEFT><font size=2>Name</font></TH><TH ALIGN=LEFT><font size=2>Type</font></TH><TH ALIGN=LEFT><font size=2>Remarks</font></TH>
      </TR>
      <?vsp adm_lt_tables_in_table(tables); ?>
    </TABLE><P>

    <input type="hidden" name="spage" value=3>
    <input type="hidden" name="frame" value="tbllst">
    <input type="hidden" name="prev" value="">
    <input type="hidden" name="next" value="">
    <input type="hidden" name="town" value="<?=_town?>">
    <input type="hidden" name="tdsn" value="<?=_tdsn?>">
    <input type="hidden" name="pwd" value="<?=_pwd?>">
    <input type="hidden" name="rows" value="<?=_rows?>">
    <input type="hidden" name="tpwd" value="<?=_tpwd?>">
    <input type="hidden" name="tqual" value="<?=_tqual?>">
    <input type="hidden" name="sql" value="<?=_sql?>">
    <input type="hidden" name="reswin" value="<?=_reswin?>">
    <input type="hidden" name="uid" value="<?=_uid?>">
    <input type="hidden" name="fontsize" value="<?=_fontsize?>">
    <input type="hidden" name="cmd" value="<?=_cmd?>">
    <input type="hidden" name="dsn" value="<?=_dsn?>">
    <input type="hidden" name="tuid" value="<?=_tuid?>">

  </FORM>
</BODY></HTML>

<?vsp
return;
}

if ('foot' = _frame)
{
?>
<!-- table selection list footer -->

<html>
<head>
<SCRIPT Language="JavaScript">
function do_prev() {
  parent.listmain.document.form.prev.value=document.form.prev.value;
  parent.listmain.document.form.submit();
}
function checklink() {
  if (parent.listmain.document.form.tablelist.checked) { return true }
  for (var i=0; i < parent.listmain.document.form.tablelist.length; i++) {
    if (parent.listmain.document.form.tablelist[i].checked) { return true }
  }
  alert("Choose at least one table to <?vsp
if (_cmd='Link')
  http('link');
else
  http('unlink');
?>");
  return false;
}
function do_next() {
  if (checklink()) {
    parent.listmain.document.form.next.value="Next";
    parent.listmain.document.form.submit();
  }
}
function do_main() {
  parent.listmain.document.form.next.value="Main";
  parent.listmain.document.form.submit();
}
</SCRIPT>
</head>
<body bgcolor="#C0C0C0">
<FORM METHOD=POST name=form>
<DIV ALIGN=right>
<SCRIPT Language="JavaScript">
if (parent.listmain.document.title!="Error") {
   document.write('<input type="button" name="prev" value="< Back" onclick="do_prev()">&nbsp;');
   document.write('<input type="button" name="next" value="Next >" onclick="do_next()">&nbsp;');
   document.write('<input type="button" name="next" value=" Main " onclick="do_main()">&nbsp;');
}
</SCRIPT>
<input type="button" name="exit" value="  Exit  " onclick="top.close()">
</DIV>
</FORM>
</BODY></HTML>

<?vsp
return;
}

if (_spage=5 AND _cmd='Link')
{
  -- dbg_obj_print (params);
  _town := ucase (_dsn);

?>

<!-- Attach details 2 -->
<head><title>Attach details</title>
<SCRIPT Language="JavaScript">
function checkfield (n, s, exclude)
{
    var i,c;
    for (i = 0; i < s.length; i++)
    {
	c = s.charAt(i);
	if (exclude.indexOf(c) >= 0) {
	    alert(n+" must not contain the character "+c);
	    return false;
	}
    }
    return true;
}
function checkform(thisform) {
     if (!checkfield("Qualifier",thisform.tqual.value,".!")) return false;
    if (!checkfield("Owner",thisform.town.value,".!")) return false;
    return true;
}
</SCRIPT>
</head>
<body bgcolor="#C0C0C0">
<form method="POST" name='page5'>
<input type="hidden" name="spage" value=5>
<input type="hidden" name="tdsn" value="<?=_tdsn?>">
<input type="hidden" name="pwd" value="<?=_pwd?>">
<input type="hidden" name="rows" value="<?=_rows?>">
<input type="hidden" name="tablelist" value="<?=adm_http_parm_concat ('tablelist', '^', params)?>">
<input type="hidden" name="tpwd" value="<?=_tpwd?>">
<input type="hidden" name="sql" value="<?=_sql?>">
<input type="hidden" name="reswin" value="<?=_reswin?>">
<input type="hidden" name="uid" value="<?=_uid?>">
<input type="hidden" name="fontsize" value="<?=_fontsize?>">
<input type="hidden" name="cmd" value="<?=_cmd?>">
<input type="hidden" name="dsn" value="<?=_dsn?>">
<input type="hidden" name="tuid" value="<?=_tuid?>">

<table border="0" cellpadding="2" cellspacing="0" width=100%>
<tr>
<td rowspan="5" width=120><img src="/images/vdlgbox.jpg" border="0"></td>
<td colspan=2><font size="2">
Here you can overrule the qualifier and owner to match
your Virtuoso DBMS environment.
</font></td>
</tr>
<tr>
<td><font size="2">Qualifier name:</font></td><td><INPUT TYPE=TEXT NAME=tqual SIZE=30 MAXLENGTH=30 VALUE="<?=dbname()?>"></td>
</tr>
<tr><td colspan=2 valign=top><font size="2">New Qualifier name.</font></td></tr>
<tr>
<td><font size="2">Owner name:</font></td><td><INPUT TYPE=TEXT NAME=town SIZE=30 VALUE="<?=_town?>"></td>
</tr>
<tr><td colspan=2 valign=top><font size="2">New Owner name.</font></td></tr>
<tr>
<td colspan=3 align=right><br>
<input type="submit" name="prev" value="< Back">&nbsp;
<input type="submit" name="next" value="Next >" onclick='return checkform(this.form)'>&nbsp;
<input type="submit" name="next" value=" Main ">&nbsp;
<input type="button" name="exit" value="  Exit   " onclick="self.close()">
</td>
</tr>
</table>
</form>
</body>

<?vsp
  return;
}
if (_spage=6 AND _cmd='Link')
{

?>

<!-- list of done links -->

<html><head><title>Linked Tables</title>
<SCRIPT Language="JavaScript">
</SCRIPT>
</head>
<body bgcolor="#C0C0C0">
<table align=center border=1 width="100%"><tr><th><font size=2>OK</font></th><th><font size=2>Link</font></th><th><font size=2>To</font></th></tr>
<?vsp
adm_lt_wiz_link_tables (_tablelist, _dsn, _town, _tqual);
?>
</table>
<form method="POST" action="/admin/admin_lt_wiz.vsp" target="_top" name=form>

<input type="hidden" name="spage" value=6>
<input type="hidden" name="prev" value="">
<input type="hidden" name="next" value="">
<input type="hidden" name="town" value="<?=_town?>">
<input type="hidden" name="tdsn" value="<?=_tdsn?>">
<input type="hidden" name="pwd" value="<?=_pwd?>">
<input type="hidden" name="rows" value="<?=_rows?>">
<input type="hidden" name="tablelist" value="<?=_tablelist?>">
<input type="hidden" name="tpwd" value="<?=_pwd?>">
<input type="hidden" name="tqual" value="<?=_tqual?>">
<input type="hidden" name="sql" value="<?=_sql?>">
<input type="hidden" name="reswin" value="<?=_reswin?>">
<input type="hidden" name="uid" value="<?=_uid?>">
<input type="hidden" name="fontsize" value="<?=_fontsize?>">
<input type="hidden" name="cmd" value="<?=_cmd?>">
<input type="hidden" name="dsn" value="<?=_dsn?>">
<input type="hidden" name="tuid" value="<?=_tuid?>">
</form></body></html>

<!-- Done list footer -->

<html>
<head>
<SCRIPT Language="JavaScript">
function do_prev() {
  parent.listmain.document.form.prev.value=document.form.prev.value;
  parent.listmain.document.form.submit();
}
function checklink() {
  if (parent.listmain.document.form.tablelist.checked) { return true }
  for (var i=0; i < parent.listmain.document.form.tablelist.length; i++) {
    if (parent.listmain.document.form.tablelist[i].checked) { return true }
  }
  alert("Please choose at least one table to link");
  return false;
}
function do_next() {
  if (checklink()) {
    parent.listmain.document.form.next.value="Next";
    parent.listmain.document.form.submit();
  }
}
function do_main() {
  parent.listmain.document.form.next.value="Main";
  parent.listmain.document.form.submit();
}
</SCRIPT>
</head>
<body bgcolor="#C0C0C0">
<FORM METHOD=POST name=form>
<DIV ALIGN=right>
<SCRIPT Language="JavaScript">
if (parent.listmain.document.title!="Error") {
 document.write('<input type="button" name="next" value=" Main " onclick="do_main()">&nbsp;');
}
</SCRIPT>
<input type="button" name="exit" value="  Exit  " onclick="top.close()">
</DIV>
</FORM>
</BODY></HTML>

<?vsp
return;
}
if (_spage=3 AND _cmd='ISQL')
{

?>
<html><head><title>SQL Statement</title></head>
<body bgcolor="#C0C0C0">
<form method="POST" name='page3' action='/admin/admin_lt_wiz.vsp'>
<input type="hidden" name="spage" value=3>
<input type="hidden" name="prev" value="">
<input type="hidden" name="next" value="">
<input type="hidden" name="pwd" value="<?=_pwd?>">
<input type="hidden" name="uid" value="<?=_uid?>">
<input type="hidden" name="cmd" value="<?=_cmd?>">
<input type="hidden" name="dsn" value="<?=_dsn?>">

<table border="0" cellpadding="2" cellspacing="0" width=100%>
<tr>
<td rowspan="3" width=120><img src="/images/vdlgbox.jpg" border="0"></td>
<td colspan="2"><font size="2">Enter the SQL statement to execute using the DSN called<br>
<?=_dsn?>:<br>
<TEXTAREA COLS=35 NAME=sql ROWS=5 WRAP=VIRTUAL><?=_sql?></TEXTAREA>
</font></td>
</tr>
<tr>
<td colspan="2"><font size="2">Maximum number of rows in resultset&nbsp;<INPUT TYPE=TEXT NAME=rows SIZE=5 MAXLENGTH=5 VALUE="<?=_rows?>"></font></td></tr>
<tr>
<td><font size="2">Result Font size&nbsp;<INPUT TYPE=TEXT NAME=fontsize SIZE=1 MAXLENGTH=1 VALUE="<?=_fontsize?>"></td>
<td><INPUT TYPE=CHECKBOX NAME="reswin"
<?vsp
if (_reswin) http(' CHECKED');
?>
>Separate window</font></td>
</tr>
<tr>
<td colspan=3 align=right><br>
<input type="submit" name="prev" value="< Back">&nbsp;
<input type="submit" name="next" value="Next >" tabindex=1>&nbsp;
<input type="submit" name="next" value=" Main ">&nbsp;
<input type="button" name="exit" value="  Exit   " onclick="self.close()">
</td>
</tr>
</table>
</form>
</body></html>

<?vsp
return;
}

if (_spage=4 AND _cmd='ISQL' AND _reswin)
{
?>
<html><head>
<SCRIPT Language="JavaScript">
var rw=window.open('','resultset','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=560,height=400');
if (rw==null) { history.go(-1);}
rw.document.write('<html><head></head><body onload="document.form.submit()">');
rw.document.write('<form method="POST" action="/admin/admin_lt_wiz.vsp" name=form>');
rw.document.write('<input type="hidden" name="spage" value=5>');
rw.document.write('<input type="hidden" name="pwd" value="<?=_pwd?>">');
rw.document.write('<input type="hidden" name="rows" value="<?=_rows?>">');
rw.document.write('<input type="hidden" name="sql" value="<?=_sql?>">');
rw.document.write('<input type="hidden" name="reswin" value="0">');
rw.document.write('<input type="hidden" name="uid" value="<?=_uid?>">');
rw.document.write('<input type="hidden" name="fontsize" value="<?=_fontsize?>">');
rw.document.write('<input type="hidden" name="cmd" value="<?=_cmd?>">');
rw.document.write('<input type="hidden" name="dsn" value="<?=_dsn?>">');
rw.document.write('</form></body></html>');
rw.document.close();
history.go(-1);
</SCRIPT></head><body></body></html>
<?vsp
return;
}

if (_spage>=4 AND _cmd='ISQL')
{
-- dbg_obj_print('4-5 and isql');
?>
<head><title>Result set</title>
<link rel="stylesheet" type="text/css" href="admin_style.html">
</head>
<body bgcolor="#C0C0C0">
<?vsp
if (_spage=4)
{
?>
<?include adm_js_check.vsp ?>
<form method="POST" action='/admin/admin_lt_wiz.vsp'>
<input type="hidden" name="spage" value=4>
<input type="button" name="prev" value="< Back" onclick="history.go(-1)">&nbsp;
<input type="submit" name="next" value=" Main " tabindex=1>&nbsp;
<input type="button" name="exit" value="  Exit  " onclick="self.close()">
</form>
<?vsp
}

  err_sqlstate := '00000';
  err_msg := 'none';

   if (dsn_is_us(_dsn, lines) ) {
-- dbg_obj_print('exec');
	exec (_sql, err_sqlstate, err_msg, vector(),
                _rows, m_dta, result);
   } else {
	declare _rowsout integer;
-- dbg_obj_print('rexecute');
	vd_remote_data_source (_dsn, '', _uid, _pwd);
	rexecute (_dsn, _sql, err_sqlstate, err_msg, vector(),
               _rowsout, m_dta, result);
   }

   --dbg_printf('exec: sqlstate %s, msg %s', err_sqlstate, err_msg);

   if ('00000' <> err_sqlstate) {
              http (sprintf ('<hr><strong>SQL Error:</strong> sqlstate %s, %s',
	                      err_sqlstate, err_msg));
      return;
    }

-- dbg_obj_print(result);
    adm_result_to_table(result, m_dta);
    http('</head><body></body></html>');
    return;
}

?>
<head><title>Error</title></head>
<body bgcolor="#C0C0C0">
Fatal error:<br>
No appropriate page to display in file /admin/admin_lt_wiz.vsp
</body>
</html>