Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Visual Basic 6 - Convertitore tra VB6 e VB2008
Forum - Visual Basic 6 - Convertitore tra VB6 e VB2008

Avatar
genuzzu (Normal User)
Pro


Messaggi: 107
Iscritto: 24/06/2009

Segnala al moderatore
Postato alle 11:26
Domenica, 26/07/2009
Ora vi spiego il mio problema... se avessi bisogno di convertire un programma da VB6 a VB2008... non ci riuscirei mai con un programma automatizzato... perchè non conosco bene ne l' uno ne l' altro! In pratica una form, dentro al file progetto, non c'è altro che questo...

Codice sorgente - presumibilmente Visual Basic 6

  1. VERSION 5.00
  2. Begin VB.Form Txt_id
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   5190
  5.    ClientLeft      =   60
  6.    ClientTop       =   450
  7.    ClientWidth     =   7860
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   5190
  10.    ScaleWidth      =   7860
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton Cmd_tutti
  13.       Caption         =   "Visualizza tutti"
  14.       Height          =   495
  15.       Left            =   5880
  16.       TabIndex        =   14
  17.       Top             =   2520
  18.       Width           =   1695
  19.    End
  20.    Begin VB.CommandButton Cmd_trova
  21.       Caption         =   "Ricerca per cognome"
  22.       Height          =   495
  23.       Left            =   5880
  24.       TabIndex        =   13
  25.       Top             =   1920
  26.       Width           =   1695
  27.    End
  28.    Begin VB.CommandButton Cmd_cancella
  29.       Caption         =   "Cancella amico"
  30.       Height          =   495
  31.       Left            =   5880
  32.       TabIndex        =   12
  33.       Top             =   1320
  34.       Width           =   1695
  35.    End
  36.    Begin VB.CommandButton Cmd_Conferma
  37.       Caption         =   "Conferma"
  38.       Enabled         =   0   'False
  39.       Height          =   495
  40.       Left            =   5880
  41.       TabIndex        =   11
  42.       Top             =   720
  43.       Width           =   1695
  44.    End
  45.    Begin VB.CommandButton Cmd_nuovo
  46.       Caption         =   "Nuovo amico"
  47.       Height          =   495
  48.       Left            =   5880
  49.       TabIndex        =   10
  50.       Top             =   120
  51.       Width           =   1695
  52.    End
  53.    Begin VB.TextBox txt_eta
  54.       DataField       =   "anni"
  55.       DataSource      =   "dt_anagrafe"
  56.       Height          =   375
  57.       Left            =   2280
  58.       TabIndex        =   3
  59.       Top             =   2520
  60.       Width           =   2415
  61.    End
  62.    Begin VB.TextBox Txt_telefono
  63.       DataField       =   "telefono"
  64.       DataSource      =   "dt_anagrafe"
  65.       Height          =   375
  66.       Left            =   2280
  67.       TabIndex        =   4
  68.       Top             =   3240
  69.       Width           =   2415
  70.    End
  71.    Begin VB.TextBox Text1
  72.       DataField       =   "ID"
  73.       DataSource      =   "dt_anagrafe"
  74.       Enabled         =   0   'False
  75.       Height          =   375
  76.       Left            =   2280
  77.       TabIndex        =   5
  78.       Top             =   3960
  79.       Width           =   2415
  80.    End
  81.    Begin VB.TextBox txt_nome
  82.       DataField       =   "nome"
  83.       DataSource      =   "dt_anagrafe"
  84.       Height          =   375
  85.       Left            =   2280
  86.       TabIndex        =   2
  87.       Top             =   1800
  88.       Width           =   2415
  89.    End
  90.    Begin VB.TextBox txt_cognome
  91.       DataField       =   "cognome"
  92.       DataSource      =   "dt_anagrafe"
  93.       Height          =   375
  94.       Left            =   2280
  95.       TabIndex        =   1
  96.       Top             =   960
  97.       Width           =   2415
  98.    End
  99.    Begin VB.Data dt_anagrafe
  100.       Caption         =   "Anagrafe"
  101.       Connect         =   "Access"
  102.       DatabaseName    =   "F:\database\amici2.mdb"
  103.       DefaultCursorType=   0  'DefaultCursor
  104.       DefaultType     =   2  'UseODBC
  105.       Exclusive       =   0   'False
  106.       Height          =   495
  107.       Left            =   240
  108.       Options         =   0
  109.       ReadOnly        =   0   'False
  110.       RecordsetType   =   1  'Dynaset
  111.       RecordSource    =   "anagrafe"
  112.       Top             =   120
  113.       Width           =   4455
  114.    End
  115.    Begin VB.Line Line1
  116.       X1              =   5520
  117.       X2              =   5520
  118.       Y1              =   0
  119.       Y2              =   5160
  120.    End
  121.    Begin VB.Label Lbl_telefono
  122.       Caption         =   "Telefono"
  123.       Height          =   375
  124.       Left            =   240
  125.       TabIndex        =   9
  126.       Top             =   3240
  127.       Width           =   1935
  128.    End
  129.    Begin VB.Label Lbl_id
  130.       Caption         =   "ID"
  131.       Height          =   375
  132.       Left            =   240
  133.       TabIndex        =   8
  134.       Top             =   3960
  135.       Width           =   1935
  136.    End
  137.    Begin VB.Label Lbl_eta
  138.       Caption         =   "Età"
  139.       Height          =   375
  140.       Left            =   240
  141.       TabIndex        =   7
  142.       Top             =   2520
  143.       Width           =   1935
  144.    End
  145.    Begin VB.Label Lbl_nome
  146.       Caption         =   "Nome"
  147.       Height          =   495
  148.       Left            =   240
  149.       TabIndex        =   6
  150.       Top             =   1680
  151.       Width           =   1935
  152.    End
  153.    Begin VB.Label lbl_cognome
  154.       Caption         =   "Cognome"
  155.       Height          =   375
  156.       Left            =   240
  157.       TabIndex        =   0
  158.       Top             =   960
  159.       Width           =   1935
  160.    End
  161. End
  162. Attribute VB_Name = "Txt_id"
  163. Attribute VB_GlobalNameSpace = False
  164. Attribute VB_Creatable = False
  165. Attribute VB_PredeclaredId = True
  166. Attribute VB_Exposed = False
  167. Dim conf As Integer
  168. Private Sub Cmd_cancella_Click()
  169. If dt_anagrafe.Recordset.BOF = True Or dt_anagrafe.Recordset.EOF = True Then
  170.         MsgBox ("fine file")
  171.         'dt_anagrafe.Recordset.MoveFirst
  172.     Else
  173.     conf = MsgBox("sei sicuro?", vbYesNo)
  174.         If conf = 6 Then
  175.         dt_anagrafe.Recordset.Delete
  176.         dt_anagrafe.Recordset.MoveNext
  177.         Else
  178.         End If
  179.  
  180. End If
  181.  
  182.  
  183.  
  184.  
  185.  
  186. Cmd_nuovo.Enabled = True
  187. Cmd_cancella.Enabled = True
  188. End Sub
  189.  
  190. Private Sub Cmd_Conferma_Click()
  191. Cmd_Conferma.Enabled = False
  192. Cmd_nuovo.Enabled = True
  193. Cmd_cancella.Enabled = True
  194. dt_anagrafe.Recordset.Update
  195. dt_anagrafe.Recordset.MoveLast
  196. End Sub
  197.  
  198. Private Sub Cmd_nuovo_Click()
  199. Cmd_Conferma.Enabled = True
  200. Cmd_nuovo.Enabled = False
  201. dt_anagrafe.Recordset.AddNew
  202. txt_cognome.SetFocus
  203. End Sub
  204.  
  205. Private Sub Cmd_trova_Click()
  206. Dim cognomeinput As String
  207. cognomeinput = InputBox("inserisci il cognome delle persono che vuoi ricercare", "inserisci...")
  208. dt_anagrafe.RecordSource = "SELECT * FROM anagrafe WHERE anagrafe.cognome = '" & cognomeinput & "'"
  209. dt_anagrafe.Refresh
  210. End Sub
  211.  
  212. Private Sub Cmd_tutti_Click()
  213. dt_anagrafe.RecordSource = "SELECT * FROM anagrafe"
  214. dt_anagrafe.Refresh
  215. End Sub




E' una specie di rubrica con un database... qualcuno riuscirebbe a fare un convertitore... oppure lo conosce già! :(

PM Quote
Avatar
theprogrammer (Normal User)
Guru^2


Messaggi: 2509
Iscritto: 28/01/2009

Segnala al moderatore
Postato alle 11:29
Domenica, 26/07/2009
Scusa, ma la domanda per il codice VB6 qual e'?

Questo e' il forum per il VB6 ... se devi scrivere codice VB.NET (anche se a partire da codice VB6) non e' questo il forum dove puoi avere risposte ...

PM Quote