-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathEasyQuery.frm
2890 lines (2260 loc) · 85 KB
/
EasyQuery.frm
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
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.MDIForm frmMain
BackColor = &H8000000C&
Caption = "Easy Query !"
ClientHeight = 6120
ClientLeft = 1920
ClientTop = 4005
ClientWidth = 9705
Icon = "EasyQuery.frx":0000
LinkTopic = "MDIForm1"
NegotiateToolbars= 0 'False
Begin MSComctlLib.Toolbar Toolbar
Align = 1 'Align Top
Height = 360
Left = 0
TabIndex = 1
Top = 0
Width = 9705
_ExtentX = 17119
_ExtentY = 635
ButtonWidth = 609
ButtonHeight = 582
AllowCustomize = 0 'False
Appearance = 1
Style = 1
ImageList = "imgVB6"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 33
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdConectar"
Object.ToolTipText = "Conectar a origen de datos"
ImageIndex = 1
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdDesconectar"
Object.ToolTipText = "Desconectar origen de datos"
ImageIndex = 2
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdIniTrx"
Object.ToolTipText = "Iniciar transacción"
ImageIndex = 3
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Key = "cmdRollTrx"
Object.ToolTipText = "Deshacer transacción"
ImageIndex = 4
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Key = "cmdFinTrx"
Object.ToolTipText = "Finalizar transacción"
ImageIndex = 5
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdNuevo"
Object.ToolTipText = "Nuevo query"
ImageIndex = 6
EndProperty
BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdEliminar"
Object.ToolTipText = "Eliminar query"
ImageIndex = 7
EndProperty
BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdLimpiar"
Object.ToolTipText = "Limpiar query"
ImageIndex = 8
EndProperty
BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdAscendente"
Object.ToolTipText = "Ordenar columnas ascendentemente"
ImageIndex = 9
EndProperty
BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdDescendente"
Object.ToolTipText = "Ordenar columnas descendentemente"
ImageIndex = 10
EndProperty
BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdAbrir"
Object.ToolTipText = "Abrir archivo de texto"
ImageIndex = 11
EndProperty
BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdGuardar"
Object.ToolTipText = "Guardar texto a archivo"
ImageIndex = 12
EndProperty
BeginProperty Button18 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdImprimir"
Object.ToolTipText = "Imprimir texto a impresora"
ImageIndex = 13
EndProperty
BeginProperty Button19 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button20 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdCopiar"
Object.ToolTipText = "Copia texto al portapapeles"
ImageIndex = 14
EndProperty
BeginProperty Button21 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdCortar"
Object.ToolTipText = "Corta el texto al portapapeles"
ImageIndex = 15
EndProperty
BeginProperty Button22 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdPegar"
Object.ToolTipText = "Pega el texto del portapapeles"
ImageIndex = 16
EndProperty
BeginProperty Button23 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdDeshacer"
Object.ToolTipText = "Deshace los cambios hechos"
ImageIndex = 17
EndProperty
BeginProperty Button24 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button25 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Key = "cmdBuscar"
Object.ToolTipText = "Ejecuta la sentencia sql"
ImageIndex = 18
EndProperty
BeginProperty Button26 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Key = "cmdQStop"
Object.ToolTipText = "Detener ejecución de sql"
ImageIndex = 25
EndProperty
BeginProperty Button27 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Key = "cmdDetener"
Object.ToolTipText = "Parar carga de registros"
ImageIndex = 19
EndProperty
BeginProperty Button28 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button29 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdCascade"
Object.ToolTipText = "Organizar ventanas en cascada"
ImageIndex = 22
EndProperty
BeginProperty Button30 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdTileH"
Object.ToolTipText = "Organizar ventanas horizontalmente"
ImageIndex = 24
EndProperty
BeginProperty Button31 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdTileV"
Object.ToolTipText = "Organizar ventanas verticalmente"
ImageIndex = 23
EndProperty
BeginProperty Button32 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button33 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmdSalir"
Object.ToolTipText = "Salir de la aplicación"
ImageIndex = 20
EndProperty
EndProperty
End
Begin MSComctlLib.ImageList imgVB6
Left = 615
Top = 1650
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 25
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":08CA
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":0BE6
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":0F02
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":105E
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":11BA
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":1316
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":142A
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":1D06
Key = ""
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":2022
Key = ""
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":2136
Key = ""
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":224A
Key = ""
EndProperty
BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":235E
Key = ""
EndProperty
BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":2472
Key = ""
EndProperty
BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":2586
Key = ""
EndProperty
BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":269A
Key = ""
EndProperty
BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":27AE
Key = ""
EndProperty
BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":28C2
Key = ""
EndProperty
BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":29D6
Key = ""
EndProperty
BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":2CF2
Key = ""
EndProperty
BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":2E06
Key = ""
EndProperty
BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":325A
Key = ""
EndProperty
BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":33B6
Key = ""
EndProperty
BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":3512
Key = ""
EndProperty
BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":366E
Key = ""
EndProperty
BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "EasyQuery.frx":37CA
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.StatusBar staBar
Align = 2 'Align Bottom
Height = 270
Left = 0
TabIndex = 0
Top = 5850
Width = 9705
_ExtentX = 17119
_ExtentY = 476
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 2
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 7056
MinWidth = 7056
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
EndProperty
EndProperty
End
Begin VB.Menu mnuArchivox
Caption = "&Archivo"
Begin VB.Menu mnuQuery_Conectar
Caption = "&Conectar origen de datos"
End
Begin VB.Menu mnuQuery_Desconectar
Caption = "&Desconectar origen de datos"
End
Begin VB.Menu mnuQuery_Sep99
Caption = "-"
End
Begin VB.Menu mnuQuery_Nuevahoja
Caption = "&Nuevo Query"
Shortcut = ^N
End
Begin VB.Menu mnuQuery_EliminarHoja
Caption = "&Eliminar Query"
Shortcut = ^D
End
Begin VB.Menu mnuQuery_sep2
Caption = "-"
End
Begin VB.Menu mnuQuery_AbrirconsultaSQL
Caption = "&Abrir consulta SQL"
Shortcut = ^O
End
Begin VB.Menu mnuQuery_GuardarSQL
Caption = "&Guardar SQL"
Shortcut = ^G
End
Begin VB.Menu mnuQuery_sep3
Caption = "-"
End
Begin VB.Menu mnuQuery_ConfigImpresora
Caption = "&Configurar Página"
End
Begin VB.Menu mnuQuery_ImprimirSQL
Caption = "&Imprimir SQL"
Shortcut = ^P
End
Begin VB.Menu mnuQuery_sep4
Caption = "-"
End
Begin VB.Menu mnuQuery_Salir
Caption = "&Salir"
End
End
Begin VB.Menu mnuEdicion
Caption = "&Edición"
Begin VB.Menu mnuEdicion_Deshacer
Caption = "&Deshacer"
Shortcut = ^Q
End
Begin VB.Menu mnuEdicion_Copiar
Caption = "&Copiar"
End
Begin VB.Menu mnuEdicion_Pegar
Caption = "&Pegar"
End
Begin VB.Menu mnuEdicion_Cortar
Caption = "C&ortar"
End
Begin VB.Menu mnuEdicion_Borrar
Caption = "&Borrar"
End
Begin VB.Menu mnuEdicion_sep1
Caption = "-"
End
Begin VB.Menu mnuEdicion_SeleccionarTodo
Caption = "&Seleccionar todo ..."
Shortcut = ^S
End
Begin VB.Menu mnuEdicion_sep2
Caption = "-"
End
Begin VB.Menu mnuEdicion_Buscar
Caption = "B&uscar"
Shortcut = ^F
End
Begin VB.Menu mnuEdicion_BuscarSiguiente
Caption = "Buscar Si&guiente"
Shortcut = {F3}
End
Begin VB.Menu mnuEdicion_sep3
Caption = "-"
End
Begin VB.Menu mnuEdicion_Reemplazar
Caption = "&Reemplazar"
Shortcut = ^R
End
End
Begin VB.Menu mnuQuery
Caption = "&Query"
Enabled = 0 'False
Begin VB.Menu mnuQuery_SeleccionarTodo
Caption = "&Seleccionar todos"
Shortcut = {F7}
End
Begin VB.Menu mnuQuery_DesSeleccionarTodo
Caption = "&Cancelar selección"
Shortcut = {F9}
End
Begin VB.Menu mnuQuery_Invertir
Caption = "&Invertir selección"
End
Begin VB.Menu mnuQuery_sep1
Caption = "-"
End
Begin VB.Menu mnuQuery_CopiarDatos
Caption = "&Copiar fila ..."
Shortcut = {F8}
End
Begin VB.Menu mnuQuery_EiminarFila
Caption = "&Eliminar filas ..."
End
Begin VB.Menu mnuQuery_Imprimir
Caption = "&Imprimir"
End
Begin VB.Menu mnuQuery_CopiarHeader
Caption = "Copiar &Header"
End
Begin VB.Menu sex1
Caption = "-"
End
Begin VB.Menu mnuQuery_VerTabla
Caption = "&Ver estructura de tabla"
End
Begin VB.Menu mnuQuery_VerTodasTablas
Caption = "Ver todas las &tablas de conexión"
End
End
Begin VB.Menu mnuExportar
Caption = "&Exportar"
Enabled = 0 'False
Begin VB.Menu mnuQuery_ExportarCSV
Caption = "Exportar a .CSV"
End
Begin VB.Menu mnuQuery_ExportarXML
Caption = "Exportar a .XML"
End
Begin VB.Menu mnuQuery_ExportarTXT
Caption = "Exportar a .TXT"
End
Begin VB.Menu mnuQuery_ExportarHTM
Caption = "Exportar a .HTM"
End
Begin VB.Menu mnuQuery_ExportarXLS
Caption = "Exportar a .XLS"
End
Begin VB.Menu mnuQuery_ExportarRTF
Caption = "Exportar a .RTF"
Visible = 0 'False
End
Begin VB.Menu mnuQuery_ExportarTAB
Caption = "Exportar a .TAB"
End
End
Begin VB.Menu mnuQTabla
Caption = "&Tablas"
Enabled = 0 'False
Begin VB.Menu mnuQTabla_Agregar
Caption = "&Agregar Tabla"
End
Begin VB.Menu mnuQTabla_Qview
Caption = "&Consultar Tabla"
End
Begin VB.Menu mnuQTabla_InfoCampo
Caption = "Campos de &Tabla"
End
Begin VB.Menu mnuQTabla_Eliminar
Caption = "&Eliminar Tabla"
End
Begin VB.Menu mnuQTabla_sep1
Caption = "-"
End
Begin VB.Menu mnuQTabla_Actualizar
Caption = "Actuali&zar"
End
End
Begin VB.Menu mnuVista
Caption = "&Vistas"
Enabled = 0 'False
Begin VB.Menu mnuVista_Agregar
Caption = "&Agregar Vista"
End
Begin VB.Menu mnuVista_Consultar
Caption = "&Consultar Vista"
End
Begin VB.Menu mnuVista_Campos
Caption = "Campos de &Vista"
End
Begin VB.Menu mnuVista_Eliminar
Caption = "&Eliminar Vista"
End
Begin VB.Menu mnuVista_sep1
Caption = "-"
End
Begin VB.Menu mnuVista_Actualizar
Caption = "Actuali&zar"
End
End
Begin VB.Menu mnuProcs
Caption = "&Procedimientos"
Enabled = 0 'False
Begin VB.Menu mnuProcs_Add
Caption = "&Agregar"
End
Begin VB.Menu mnuProcs_Editar
Caption = "E&ditar"
End
Begin VB.Menu mnuProcs_Del
Caption = "&Eliminar"
End
Begin VB.Menu mnuProcs_Run
Caption = "E&jecutar"
End
Begin VB.Menu mnuProcs_sep1
Caption = "-"
End
Begin VB.Menu mnuProcs_Actualizar
Caption = "Actuali&zar"
End
End
Begin VB.Menu mnuOpciones
Caption = "&Opciones"
Begin VB.Menu mnuOpciones_Configuracion
Caption = "&Configurar Comandos críticos"
End
Begin VB.Menu mnuOpciones_ConfQuery
Caption = "Configurar &Editor de Querys"
End
Begin VB.Menu mnuOpciones_Historial
Caption = "Configurar &Historial de Querys"
End
Begin VB.Menu mnuOpciones_Sep0
Caption = "-"
End
Begin VB.Menu mnuOpciones_Colores
Caption = "Colores sentencias &SQL"
End
Begin VB.Menu mnuOpciones_Skin
Caption = "&Skin"
Enabled = 0 'False
Visible = 0 'False
End
Begin VB.Menu mnuOpciones_Sep1
Caption = "-"
End
Begin VB.Menu mnuOpciones_Browser
Caption = "&Browser de Querys"
End
Begin VB.Menu mnuOpciones_FTexto
Caption = "&Formato de Texto"
Visible = 0 'False
End
Begin VB.Menu mnuOpciones_SiempreVisible
Caption = "Siempre &visible"
End
End
Begin VB.Menu mnuVentana
Caption = "&Ventana"
WindowList = -1 'True
Begin VB.Menu mnuVentana_Cascada
Caption = "&Cascada"
End
Begin VB.Menu mnuVentana_Horizontal
Caption = "&Horizontal"
End
Begin VB.Menu mnuVentana_Vertical
Caption = "&Vertical"
End
Begin VB.Menu mnuVentana_sep1
Caption = "-"
End
Begin VB.Menu mnuVentana_Organizar
Caption = "&Organizar ventanas"
End
End
Begin VB.Menu mnuAyuda
Caption = "A&yuda"
Begin VB.Menu mnuAyuda_Contenido
Caption = "&Contenido"
End
Begin VB.Menu mnuAyuda_Indice
Caption = "&Indice"
End
Begin VB.Menu mnuAyuda_Busqueda
Caption = "&Búsqueda"
End
Begin VB.Menu mnuAyuda_sep1
Caption = "-"
End
Begin VB.Menu mnuAyuda_Web
Caption = "&Easy Query ! en el WEB"
End
Begin VB.Menu mnuAyuda_AcercaDe
Caption = "&Acerca de Easy Query ! ..."
End
End
Begin VB.Menu mnuTablas
Caption = "Tablas"
Visible = 0 'False
Begin VB.Menu mnuTablas_ImprimirCampos
Caption = "Imprimir campos consulta"
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private WithEvents xConnection As ADODB.Connection
Attribute xConnection.VB_VarHelpID = -1
Private WithEvents xRecordset As ADODB.Recordset
Attribute xRecordset.VB_VarHelpID = -1
Public m_Detener As Boolean
Public m_Cancelar As Boolean
Public m_Ejecutando As Boolean
Private itmx As ListItem
Private Sub AbreSql()
On Local Error GoTo ErrorAbreSql
Dim cc As New GCommonDialog
Dim Archivo As String
Dim nArchivo As Integer
Dim sql As String
Dim Glosa As String
If Not frmMain.ActiveForm Is Nothing Then
Glosa = "Archivos de comandos Sql (*.SQL)|*.SQL|"
Glosa = Glosa & "Archivos de Texto (*.TXT)|*.TXT|"
Glosa = Glosa & "Todos los archivos (*.*)|*.*"
If Not (cc.VBGetOpenFileName(Archivo, , , , , , Glosa, , App.Path, "Abrir archivo ...", "SQL", Me.hwnd)) Then
Exit Sub
End If
If Archivo <> "" Then
nArchivo = FreeFile
Open Archivo For Input As #nArchivo
sql = Input(LOF(nArchivo), nArchivo)
Close #nArchivo
frmMain.ActiveForm.txtQuery.Text = vbNullString
frmMain.ActiveForm.txtQuery.SelColor = glbColorSql
frmMain.ActiveForm.txtQuery.Text = sql
End If
'frmMain.ActiveForm.txtQuery.Visible = False
frmMain.ActiveForm.HayCambios = True
Call frmMain.ActiveForm.FormateaSentencias
'frmMain.ActiveForm.txtQuery.Visible = True
frmMain.ActiveForm.txtQuery.SetFocus
End If
Set cc = Nothing
GoTo SalirAbreSql
ErrorAbreSql:
Resume SalirAbreSql
SalirAbreSql:
Err = 0
End Sub
Private Sub Ascendente()
If Not frmMain.ActiveForm Is Nothing Then
If frmMain.ActiveForm.griQuery.DataRowCnt > 0 Then
frmMain.ActiveForm.griQuery.Col = 1 'frmMain.ActiveForm.griQuery.ActiveCol
frmMain.ActiveForm.griQuery.Col2 = frmMain.ActiveForm.griQuery.MaxCols
frmMain.ActiveForm.griQuery.Row = 0
frmMain.ActiveForm.griQuery.Row2 = frmMain.ActiveForm.griQuery.DataRowCnt
frmMain.ActiveForm.griQuery.SortBy = 0
frmMain.ActiveForm.griQuery.SortKey(1) = frmMain.ActiveForm.griQuery.ActiveCol
frmMain.ActiveForm.griQuery.SortKeyOrder(1) = 1
frmMain.ActiveForm.griQuery.Action = 25
End If
End If
End Sub
Private Sub CargarInformacionDeCampos(ByRef NCampos As Integer)
Dim Nombre As String
Dim Campo As Field
NCampos = 2
With xRecordset
'configurar celdas de la spread segun tipos de campos del recordset
Call ConfiguraCeldas(xRecordset, NCampos)
'llenar listview de campos
For Each Campo In .Fields
Nombre = Campo.Name
Set itmx = frmMain.ActiveForm.lviewDetalle.ListItems.Add()
itmx.Text = Nombre
itmx.Icon = 3
itmx.SmallIcon = 3
itmx.SubItems(1) = TipoDeCampo(Campo.Type)
itmx.SubItems(2) = Campo.DefinedSize
itmx.SubItems(3) = Campo.Precision
If (Campo.Attributes And adFldIsNullable) Then
itmx.SubItems(4) = "Si"
Else
itmx.SubItems(4) = "No"
End If
Next
End With
Set Campo = Nothing
End Sub
'cargar registros
Private Sub CargarRegistros(ByRef NCampos As Integer)
Dim e As Long
Dim f As Long
Dim K As Integer
f = 1
'ciclar x los registros devueltos
With xRecordset
Do While Not .EOF
e = DoEvents()
'detener carga de registros
If m_Detener Then
m_Detener = False
Exit Do
End If
'cada 100 filas incrementar
If f Mod 100 = 0 Then
frmMain.ActiveForm.griQuery.MaxRows = frmMain.ActiveForm.griQuery.MaxRows + 100
End If
'llenar x columnas
For K = 2 To NCampos - 1
If Not IsNull(.Fields(K - 2)) Then
Call frmMain.ActiveForm.griQuery.SetText(K, f, .Fields(K - 2))
Else
Call frmMain.ActiveForm.griQuery.SetText(K, f, "NULO")
End If
Next K
frmStop.lblRegistros.Caption = CStr(f)
f = f + 1
.MoveNext
Loop
frmMain.ActiveForm.griQuery.MaxRows = frmMain.ActiveForm.griQuery.DataRowCnt
frmMain.ActiveForm.griQuery.ReDraw = True
End With
End Sub
Private Function ChequeaComandoCritico() As Boolean
Dim K As Integer
Dim ret As Boolean
Dim sql As String
sql = Trim$(ClearEnterInString(frmMain.ActiveForm.txtQuery.Text))
ret = False
For K = 1 To UBound(Comandos)
If Comandos(K).Activo Then
If UCase$(Trim$(Comandos(K).Comando)) = UCase$(Left$(sql, Len(Comandos(K).Comando))) Then
ret = True
Exit For
End If
End If
Next K
ChequeaComandoCritico = ret
End Function
'configura la celda de la spread
Private Sub ConfiguraCeldas(Rs As ADODB.Recordset, ByRef NCampos As Integer)
Dim Campo As Field
Dim Nombre As String
Dim sCampo As String
Dim Flagx As Boolean
'cargar headers de la spread
frmMain.ActiveForm.griQuery.BlockMode = False
For Each Campo In Rs.Fields
If NCampos > frmMain.ActiveForm.griQuery.MaxCols Then
frmMain.ActiveForm.griQuery.MaxCols = frmMain.ActiveForm.griQuery.MaxCols + 1
End If
Nombre = Campo.Name
Set itmx = frmMain.ActiveForm.lviewCampos.ListItems.Add()
itmx.Text = Nombre
itmx.Icon = 3
itmx.SmallIcon = 3
frmMain.ActiveForm.griQuery.Col = NCampos
frmMain.ActiveForm.griQuery.Row = 0
frmMain.ActiveForm.griQuery.Text = Nombre
frmMain.ActiveForm.griQuery.Col = NCampos
sCampo = TipoDeCampo(Campo.Type)
Flagx = False
Select Case sCampo
Case "BigInt", "Currency", "Decimal", "Double", "Integer", "LongVarBinary", _
"Numeric", "Single", "SmallInt", "TinyInt", "UnsignedBigInt", _
"UnsignedInt", "UnsignedSmallInt", "UnsignedTinyInt"
Flagx = True
frmMain.ActiveForm.griQuery.Row = -1
frmMain.ActiveForm.griQuery.Row2 = -1
frmMain.ActiveForm.griQuery.Col = NCampos
frmMain.ActiveForm.griQuery.Col2 = NCampos
frmMain.ActiveForm.griQuery.CellType = CellTypeStaticText
frmMain.ActiveForm.griQuery.TypeHAlign = 1
frmMain.ActiveForm.griQuery.TypeVAlign = 2
End Select
NCampos = NCampos + 1
Next
End Sub
Private Sub Descendente()
If Not frmMain.ActiveForm Is Nothing Then
If frmMain.ActiveForm.griQuery.DataRowCnt > 0 Then
frmMain.ActiveForm.griQuery.Col = 1 'frmMain.ActiveForm.griQuery.ActiveCol
frmMain.ActiveForm.griQuery.Col2 = frmMain.ActiveForm.griQuery.MaxCols
frmMain.ActiveForm.griQuery.Row = 0
frmMain.ActiveForm.griQuery.Row2 = frmMain.ActiveForm.griQuery.DataRowCnt
frmMain.ActiveForm.griQuery.SortBy = 0
frmMain.ActiveForm.griQuery.SortKey(1) = frmMain.ActiveForm.griQuery.ActiveCol
frmMain.ActiveForm.griQuery.SortKeyOrder(1) = 2
frmMain.ActiveForm.griQuery.Action = 25
End If
End If
End Sub
Private Sub DetenerSql()
On Local Error Resume Next
Call Hourglass(hwnd, True)
m_Cancelar = True
frmMain.ActiveForm.staQuery.Panels(2).Text = "Cancelando ejecución de SQL"
xRecordset.Cancel
frmMain.ActiveForm.staQuery.Panels(2).Text = "Ejecución de sentencia SQL cancelada con éxito."
Err = 0
End Sub
Public Sub EjecutaQuery2(Optional ByVal cmdx As ADODB.Command)
On Local Error GoTo ErrorEjecutaQuery
Dim ActiveConexion As Integer
Dim ci As ComboItem
Dim Msg As String
Dim e As Long
'verificar cual es el origen de datos activo
Set ci = frmMain.ActiveForm.imgConexiones.SelectedItem
ActiveConexion = ConexionActiva(ci.Text)
'limpiar info
Call LimpiarGrilla
'requiere confirmacion del usuario ?
If ChequeaComandoCritico() Then
Msg = "Confirma ejecutar este comando crítico definido."
If Confirma(Msg) = vbNo Then GoTo Salir
End If
'comenzar
Call Hourglass(hwnd, True)
Call HabilitaMenues(False)
Call HabilitaBotones(False)
Toolbar.Buttons("cmdQStop").Enabled = True
Toolbar.Buttons("cmdSalir").Enabled = False
frmMain.ActiveForm.txtQuery.Enabled = False
'encender flag de ejecucion
m_Ejecutando = True
'preparar conexion y recordset
Set xConnection = New ADODB.Connection
Set xConnection = DBConnection(ActiveConexion)
xConnection.CommandTimeout = glbTimeOut
Set xRecordset = New ADODB.Recordset
Set xRecordset.ActiveConnection = xConnection
xRecordset.CursorLocation = adUseServer
If cState(ActiveConexion).tipo = TIPO_ODBC Then
Set xRecordset = xConnection.Execute(frmMain.ActiveForm.txtQuery.Text)
Else
Set xRecordset = cmdx.Execute
End If
'ejecutar sql
'esperar hasta que conteste el equipo
On Local Error Resume Next
Do While xRecordset.State = adStateExecuting
e = DoEvents
If m_Cancelar Then
Exit Do
End If
Loop
Err = 0
'carga de campos y de registros
Call SQLStart
frmMain.ActiveForm.staQuery.Panels(2).Text = "Listo."
GoTo Salir
ErrorEjecutaQuery:
If Not frmMain.ActiveForm Is Nothing Then
If Err > 0 And Not m_Cancelar Then
frmMain.ActiveForm.staQuery.Panels(2).Text = Error$
End If
End If
Resume Salir
Salir:
Unload frmStop
Err = 0
Call Hourglass(hwnd, False)
Call HabilitaBotones(True)
Call HabiBotones2
Call HabilitaMenues(True)
If Not frmMain.ActiveForm Is Nothing Then
frmMain.ActiveForm.txtQuery.Enabled = True
On Local Error Resume Next
frmMain.ActiveForm.txtQuery.SetFocus
Err = 0
End If