i want to open file from VB6

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

34 Replies - 12013 Views - Last Post: 09 March 2011 - 05:04 PM Rate Topic: -----

#1 Azrie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 25-February 11

i want to open file from VB6

Posted 26 February 2011 - 07:35 AM

Private Sub Command2_Click() If File1.FileName = "" Then MsgBox "Please select directory and file name", vbExclamation, "Missing" Else Call ShellExecute(hWnd, "Open", Dir1.Path & "\" & File1.FileName, "", App.Path, 1) End If End Sub


please help me.i want to create command button to open the file. but when i run they said sub and function not define..please help me to solve that problem...

This post has been edited by AdamSpeight2008: 27 February 2011 - 06:19 AM


Is This A Good Question/Topic? 0
  • +

Replies To: i want to open file from VB6

#2 Azrie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 25-February 11

Re: i want to open file from VB6

Posted 26 February 2011 - 07:43 AM

If File1.FileName = "" Then
MsgBox "Please select directory and file name", vbExclamation, "Missing"
Else
Call ShellExecute(hWnd, "Open", Dir1.Path & "\" & File1.FileName, "", App.Path, 1)
End If...


when i click button open the window, they highlight the debug at the Call ShellExecute...after they said sub or function not defined...please help me....

This post has been edited by AdamSpeight2008: 27 February 2011 - 06:19 AM

Was This Post Helpful? 0
  • +
  • -

#3 Azrie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 25-February 11

Re: i want to open file from VB6

Posted 26 February 2011 - 08:00 AM

If File1.FileName = "" Then
MsgBox "Please select directory and file name", vbExclamation, "Missing"
Else
Call ShellExecute(hWnd, "Open", Dir1.Path & "\" & File1.FileName, "", App.Path, 1)
End If...


when i click button open the window, they highlight the debug at the Call ShellExecute...after they said sub or function not defined...please help me....

This post has been edited by AdamSpeight2008: 27 February 2011 - 06:19 AM

Was This Post Helpful? 0
  • +
  • -

#4 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: i want to open file from VB6

Posted 26 February 2011 - 05:29 PM

ShellExecute is an API, so do you have the API declared in your code??

This post has been edited by maj3091: 26 February 2011 - 05:30 PM

Was This Post Helpful? 1
  • +
  • -

#5 Guest_Azrie*


Reputation:

Re: i want to open file from VB6

Posted 26 February 2011 - 08:31 PM

View Postmaj3091, on 26 February 2011 - 05:29 PM, said:

ShellExecute is an API, so do you have the API declared in your code??

Was This Post Helpful? 1

#6 Guest_Guest*


Reputation:

Re: i want to open file from VB6

Posted 26 February 2011 - 08:36 PM

ok thankz buddy..i just manage may coding..and i just add the model and write a few coding..and i sucess to open any file format.but i confius and did not know how exctly to use sstab in the form..can u help me they way to use it.......did u have email..can i add u in yahoo messenger..if u dont mind...
Was This Post Helpful? 0

#7 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: i want to open file from VB6

Posted 27 February 2011 - 03:20 AM

I do have email and messenger, but I won't be giving them out. People here will try to assist you, but please keep things in the forums....
Was This Post Helpful? 0
  • +
  • -

#8 Azrie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 25-February 11

Re: i want to open file from VB6

Posted 27 February 2011 - 05:23 AM

hurm can u assist me how to use sstab???
Was This Post Helpful? 0
  • +
  • -

#9 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: i want to open file from VB6

Posted 27 February 2011 - 05:51 AM

If you post what code you have in relation to ssTab and the issues you have, then yes I can assist.

Please don't expect me or others to google or look on other search engines for you, at least have a go at it and post back with what you have.
Was This Post Helpful? 0
  • +
  • -

#10 Azrie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 25-February 11

Re: i want to open file from VB6

Posted 27 February 2011 - 05:56 AM

basically,from the exmple that i look and make as a guidance,in the sstab they not include the code.....this the code behind the form...


Private Declare Function GetComputerName Lib "kernel32" Alias _
    "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long

' Returns the name of the computer.

Function ComputerName() As String
    Dim buffer As String * 512, length As Long
    length = Len(buffer)
    If GetComputerName(buffer, length) Then
        ' this API returns non-zero if successful,
        ' and modifies the length argument
        ComputerName = Left$(buffer, length)
    End If
End Function

Private Sub Command1_Click()
         Dim a As Integer
a = MsgBox("Are You Sure Want to Exit Program", vbYesNo + vbQuestion, "EXIT")
If a = vbYes Then


        Adodc1.RecordSource = "select * from tbllog"
        Adodc1.Refresh

        Adodc1.Recordset.AddNew

            Adodc1.Recordset!username = Mainsystem.StatusBar1.Panels(2).Text
            Adodc1.Recordset!Date = Date
            Adodc1.Recordset!Time = Time
            Adodc1.Recordset!Status = "Logout from system"

        
        Adodc1.Recordset.Update
        frmLogin.Show
        Unload Me
End If

End Sub

Private Sub Command10_Click()
If Text21.Text = "" Then
MsgBox "Please insert Remarks", vbExclamation, "Missing"
Text21.SetFocus


ElseIf Combo5.Text = "" Then
MsgBox "Please choose Action", vbExclamation, "Missing"
Combo5.SetFocus

Else


    Adodc1.RecordSource = "select * from tblaction"
    Adodc1.Refresh
        
    Adodc1.Recordset.AddNew
        
    Adodc1.Recordset!username = Mainsystem.StatusBar1.Panels(2).Text
    Adodc1.Recordset!Date = Mainsystem.StatusBar1.Panels(4).Text
    Adodc1.Recordset!Time = Mainsystem.StatusBar1.Panels(6).Text
    Adodc1.Recordset!FileName = Text25.Text
    Adodc1.Recordset!Directory = Text26.Text
    Adodc1.Recordset!Filetype = Text27.Text
    Adodc1.Recordset!DateCreated = Text28.Text
    Adodc1.Recordset!Datemodified = Text29.Text
    Adodc1.Recordset!Retentiondate = Text30.Text
    Adodc1.Recordset!Remarks = Text21.Text
    Adodc1.Recordset!Action = Combo5.Text

    Adodc1.Recordset.Update
        
    MsgBox "Successful", vbInformation, "Status"
    Text25.Text = ""
    Text26.Text = ""
    Text27.Text = ""
    Text28.Text = ""
    Text29.Text = ""
    Text30.Text = ""
    Text21.Text = ""
    Combo5.Text = ""

    End If
 

End Sub



Private Sub Command11_Click()


'Dim sql, VAR As String
'
'
'
'If Combo8.Text = "User log" Then
'
'
'        Adodc1.RecordSource = "select * from tblLog"
'        Adodc1.Refresh
'
'            If Adodc1.Recordset.EOF Then
'            On Error Resume Next
'            Else
'
'            Set DataGrid2.DataSource = Adodc1
'        End If
'
'
'        sql = "select * from tblLog"
'
'        Adodc1.RecordSource = "select * from tbllog"
'         Adodc1.Refresh
'
'        Set DR.DataSource = Adodc1.Recordset
'
'
'        DataEnvironment1.Commands("Command1").CommandText = sql
''        DR.Sections("Section2").Controls("label1").Caption = "Log List"
''        DR.Sections("Section1").Controls("text1").DataField = "username"
'
'        DR.Sections("section2").Controls.Item("label1").Caption = "Log list"
'        DR.Sections("section1").Controls.Item("text1").DataField = "username"
'
'
'
'
'If DataEnvironment1.rsCommand1.State Then
'DataEnvironment1.rsCommand1.Close
'End If
'
'
'      DR.Show
'
'
'
'
'ElseIf Combo8.Text = "Records Description" Then
'DataReport1.Show
'
'End If
'
'
'
'
''
''ElseIf Combo8.Text = "Records Appraisal" Then
''    'ElseIf Option3.Value = True Then
''
''        Adodc1.RecordSource = "select * from tblAction"
''        Adodc1.Refresh
''
''            If Adodc1.Recordset.EOF Then
''            On Error Resume Next
''            Else
''
''            Set DataGrid1.DataSource = Adodc1
''            End If
''
''
''
''
''
''
''
''ElseIf Combo8.Text = "Records Disposal" Then
''
''
''    'ElseIf Option2.Value = True Then
''
''        Adodc1.RecordSource = "select * from tblAction where action='Disposal'"
''        Adodc1.Refresh
''
''            If Adodc1.Recordset.EOF Then
''            On Error Resume Next
''            Else
''
''            Set DataGrid1.DataSource = Adodc1
''            End If
''
''
''
''
''ElseIf Combo8.Text = "Records Transfer" Then
''
''
''
''
''        Adodc1.RecordSource = "select * from tblAction where action ='Transfer'"
''        Adodc1.Refresh
''
''            If Adodc1.Recordset.EOF Then
''            On Error Resume Next
''            Else
''
''            Set DataGrid1.DataSource = Adodc1
''            End If
''
''
''
''
''End If



End Sub

Private Sub Command12_Click()
If MsgBox("Are you sure you want to delete " & "<" & Dir1.Path & ">", vbYesNo, "Delete confirmation") = vbYes Then

       
    Dim fso As New FileSystemObject
    Dim F As Folder
    
    Set F = fso.GetFolder(Dir1.Path)
    F.Delete
    
    MsgBox "successful Delete Folder", vbInformation, "status"

Else
Exit Sub

End If




End Sub

Private Sub Command13_Click()
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
End Sub


Private Sub Command14_Click()
'Destination = Sources
Mainsystem.Text22.Text = DataGrid4.Columns.Item(2).Text
Mainsystem.Text19.Text = DataGrid4.Columns.Item(3).Text
Mainsystem.Text18.Text = DataGrid4.Columns.Item(5).Text
Mainsystem.Text1.Text = DataGrid4.Columns.Item(6).Text
Mainsystem.Text16.Text = DataGrid4.Columns.Item(7).Text
Mainsystem.Text17.Text = DataGrid4.Columns.Item(19).Text
Mainsystem.Text20.Text = ""
Mainsystem.Combo7 = ""

End Sub

Private Sub Command15_Click()

If Option7.Value = True Then
'search by ID
Adodc1.RecordSource = "select *from tblmetadata where username = '" & Text34.Text & "'"
Adodc1.Refresh

If Adodc1.Recordset.EOF = True Then
MsgBox " No Record Found", vbExclamation, "Results"


Else
MsgBox " Record Found ", vbExclamation, "Results"
Text34.Text = ""

Set DataGrid3.DataSource = Adodc1
Adodc1.Refresh
Label56.Caption = Adodc1.Recordset.RecordCount
Label57 = ""
End If

ElseIf Option3.Value = True Then
'search by filename
Adodc1.RecordSource = "select *from tblmetadata where Filename like '" & Text33.Text & "%'"
Adodc1.Refresh

If Adodc1.Recordset.EOF = True Then
MsgBox " No Record Found", vbExclamation, "Results"


Else
MsgBox " Record Found ", vbExclamation, "Results"
Text33.Text = ""
Set DataGrid3.DataSource = Adodc1
Adodc1.Refresh
Label57.Caption = Adodc1.Recordset.RecordCount
Label56 = ""

End If


End If

End Sub

Private Sub Command16_Click()
If DataEnvironment1.rsCommand1.State Then
DataEnvironment1.rsCommand1.Close
End If

If Option1.Value = True Then
    If DataEnvironment1.rsCommand1.State Then
    DataEnvironment1.rsCommand1.Close
    End If

DataEnvironment1.Command1 (Text17.Text)
DataReport1.Show

ElseIf Option2.Value = True Then
If DataEnvironment1.rsCommand2.State Then
DataEnvironment1.rsCommand2.Close
End If

DataEnvironment1.Command2 Text1.Text & "%"

DataReport2.Show
End If
End Sub

Private Sub Command17_Click()
If Combo6.Text = "" Then
'YANG NI UNUTK SYARAT KALO USER TAK CLICK TAKKAN BOLEH PROCEED

MsgBox "Please select action", vbExclamation, "Missing"
Combo6.SetFocus

Else
'Nak tangkap ape yang dipilih di combo6 berdasarkan  yg dipilih dicombo box

Adodc1.RecordSource = "select * from tblaction where Action ='" & Combo6.Text & " '"
Adodc1.Refresh

If Adodc1.Recordset.EOF = True Then
MsgBox " No Record Found", vbExclamation, "Results"

'atas ni nak rekod ape yang ada dalam adodc1 ke dalam data grid

Else
MsgBox " Records Founds ", vbExclamation, "Results"
Set DataGrid4.DataSource = Adodc1

End If
End If
End Sub

Private Sub Command19_Click()
If Text32.Text = "" Then
    MsgBox "please insert reason", vbExclamation, "Missing"
    
Else

Dim fso As New FileSystemObject
Dim FileVariable As File

Set FileVariable = fso.GetFile(Mainsystem.Dir1 & "\" & Mainsystem.File1.FileName)
FileVariable.Delete

MsgBox "File successfully delete", vbInformation, "Status"
Text32.Text = ""

Adodc1.RecordSource = "select *from tblaction"
Adodc1.Refresh

Adodc1.Recordset.AddNew

Adodc1.Recordset!username = Mainsystem.StatusBar1.Panels(2).Text
Adodc1.Recordset!Date = Date
Adodc1.Recordset!Time = Time
Adodc1.Recordset!Action = "Delete"
Adodc1.Recordset!Remarks = Mainsystem.File1.FileName & "from" & Mainsystem.Dir1.Path & "to" & Mainsystem.Dir2.Path
Adodc1.Recordset!Reason = Text1.Text

Adodc1.Recordset.Update


End If
End Sub

Private Sub Command2_Click()
If File1.FileName = "" Then
MsgBox "Please select directory and file name", vbExclamation, "Missing"
Else
Call ShellExecute(hwnd, "Open", Dir1.Path & "\" & File1.FileName, "", App.Path, 1)
End If
End Sub

Private Sub Command20_Click()
If Text32.Text = "" Then
    MsgBox "please insert reason", vbExclamation, "Missing"
    
Else

Adodc1.RecordSource = "select *from tblaction"
Adodc1.Refresh

Adodc1.Recordset.AddNew

Adodc1.Recordset!username = Mainsystem.StatusBar1.Panels(2).Text
Adodc1.Recordset!Date = Date
Adodc1.Recordset!Time = Time
Adodc1.Recordset!Action = "Copy"
Adodc1.Recordset!Remarks = Mainsystem.File1.FileName & "from" & Mainsystem.Dir1.Path & "to" & Dir2.Path
Adodc1.Recordset!Reason = Text32.Text

Adodc1.Recordset.Update


Dim fso As New FileSystemObject
Dim FileVariable As File


Set FileVariable = fso.GetFile(Mainsystem.Dir1 & "\" & Mainsystem.File1.FileName)
FileVariable.Copy (Mainsystem.Dir2.Path & "\" & Mainsystem.File1.FileName)

MsgBox "File successfully copy", vbInformation, "Status"
Text32.Text = ""
End If
End Sub

Private Sub Command21_Click()
If Text32.Text = "" Then
    MsgBox "please insert reason", vbExclamation, "Missing"
    
Else

Adodc1.RecordSource = "select *from tblaction"
Adodc1.Refresh

Adodc1.Recordset.AddNew

Adodc1.Recordset!username = Mainsystem.StatusBar1.Panels(2).Text
Adodc1.Recordset!Date = Date
Adodc1.Recordset!Time = Time
Adodc1.Recordset!Action = "Transfer"
Adodc1.Recordset!Remarks = Mainsystem.File1.FileName & "from" & Mainsystem.Dir1.Path & "to" & Dir2.Path
Adodc1.Recordset!Reason = Text32.Text

Adodc1.Recordset.Update

'move
'or copy and delete

Dim fso As New FileSystemObject
Dim FileVariable As File

Set FileVariable = fso.GetFile(Mainsystem.Dir1.Path & "\" & Mainsystem.File1.FileName)
FileVariable.Copy (Dir2.Path & "\" & File1.FileName)
FileVariable.Delete

MsgBox " File been succesfully Transferred. All information been stored inside database", vbInformation, "Status"
Text32.Text = ""

End If

End Sub

Private Sub Command3_Click()
Dim fso As New FileSystemObject
Dim F As Folder

Set F = fso.CreateFolder(Dir1.Path & "\" & Text31.Text)

MsgBox "successful Create New Folder", vbInformation, "status"
End Sub

Private Sub Command4_Click()
Mainsystem.Text25.Text = DataGrid1.Columns.Item(2).Text
Mainsystem.Text26.Text = DataGrid1.Columns.Item(3).Text
Mainsystem.Text27.Text = DataGrid1.Columns.Item(5).Text
Mainsystem.Text28.Text = DataGrid1.Columns.Item(6).Text
Mainsystem.Text29.Text = DataGrid1.Columns.Item(7).Text
Mainsystem.Text30.Text = DataGrid1.Columns.Item(19).Text



End Sub

Private Sub Command5_Click()
Mainsystem.Show
Unload Me
End Sub

Private Sub Command6_Click()
If Text20.Text = "" Then
MsgBox "Please insert Remarks", vbExclamation, "Missing"
Text20.SetFocus


ElseIf Combo7.Text = "" Then
MsgBox "Please choose Action", vbExclamation, "Missing"
Combo7.SetFocus


Else

        Adodc1.RecordSource = "select * from tblaction"
        Adodc1.Refresh
        
        Adodc1.Recordset.AddNew
        Adodc1.Recordset!username = Mainsystem.StatusBar1.Panels(2).Text
        Adodc1.Recordset!Date = Mainsystem.StatusBar1.Panels(4).Text
        Adodc1.Recordset!Time = Mainsystem.StatusBar1.Panels(6).Text
        Adodc1.Recordset!FileName = Text22.Text
        Adodc1.Recordset!Directory = Text19.Text
        Adodc1.Recordset!Filetype = Text18.Text
        Adodc1.Recordset!DateCreated = Text1.Text
        Adodc1.Recordset!Datemodified = Text16.Text
        Adodc1.Recordset!Retentiondate = Text17.Text
        Adodc1.Recordset!Remarks = Text20.Text
        Adodc1.Recordset!Action = Combo7.Text
        
        Adodc1.Recordset.Update
        
        MsgBox "Successful", vbInformation, "Status"
        Text22.Text = ""
        Text19.Text = ""
        Text18.Text = ""
        Text1.Text = ""
        Text16.Text = ""
        Text17.Text = ""
        Text20.Text = ""
        Combo7.Text = ""
        Text20.Text = ""
        Combo7.Text = ""

        End If
        
End Sub

Private Sub Command7_Click()

Dim VAR As String
VAR = Combo8.Text


If Combo8.Text = "" Then
        MsgBox "Please select your option", vbCritical, "Alert!!"
    Combo8.SetFocus
      
  
Else

If Combo8.Text = "User log" Then
    
    
        Adodc1.RecordSource = "select * from tblLog"
        Adodc1.Refresh
            If Adodc1.Recordset.EOF Then
            On Error Resume Next
            Else
            
            Set DataGrid2.DataSource = Adodc1
        End If
     

ElseIf Combo8.Text = "Records Description" Then
    
        Adodc1.RecordSource = "select * from tblmetadata"
        Adodc1.Refresh

            If Adodc1.Recordset.EOF Then
            On Error Resume Next
            
            Else
            Set DataGrid2.DataSource = Adodc1
            End If
           


ElseIf Combo8.Text = "Records Appraisal" Then
    'ElseIf Option3.Value = True Then
    
        Adodc1.RecordSource = "select * from tblAction"
        Adodc1.Refresh

            If Adodc1.Recordset.EOF Then
            On Error Resume Next
            Else
            
            Set DataGrid1.DataSource = Adodc1
            End If
          


ElseIf Combo8.Text = "Records Disposal" Then


    'ElseIf Option2.Value = True Then
    
        Adodc1.RecordSource = "select * from tblAction where action='Disposal'"
        Adodc1.Refresh

            If Adodc1.Recordset.EOF Then
            On Error Resume Next
            Else
            
            Set DataGrid1.DataSource = Adodc1
            End If
        



ElseIf Combo8.Text = "Records Transfer" Then


        Adodc1.RecordSource = "select * from tblAction where action ='Transfer'"
        Adodc1.Refresh

            If Adodc1.Recordset.EOF Then
            On Error Resume Next
            Else
            
            Set DataGrid1.DataSource = Adodc1
            End If
           



End If
        
        
End If
        
        
        
        
        
End Sub

Private Sub Command8_Click()

Dim bo As Boolean

Adodc1.RecordSource = "select * from tblmetadata where DateCreated='" & Text6.Text & "'"
Adodc1.Refresh

If Adodc1.Recordset.EOF Then
bo = False
Else
bo = True
End If



If Text6.Text = "" Then
MsgBox "Cannot update", vbExclamation, "No records (Date created"

ElseIf bo = False Then
MsgBox "Records must be saved first", vbCritical, "Cannot update because no date created"


Else

        Dim CN As ADODB.Connection
             Set CN = New ADODB.Connection
             Dim sql As String
 
        CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=electronicrecords.mdb"

        sql = "update tblmetadata set Agencyname='" & Text10.Text & "', Departmentname='" & Text11.Text & "', Fileclassification='" & Text12.Text & "', Pages='" & Text13.Text & "' , Location='" & Text12.Text & "', Accesprivilage='" & Combo2.Text & "', Ownerofrecords='" & Text14.Text & "', typeofrecords='" & Combo4.Text & "', Classifyrecords='" & Combo3.Text & "', Retentiondate='" & DTPicker2.Value & "', Remarks='" & Text15.Text & "'  where datecreated ='" & Text6.Text & "'"
        ' sql = "update tblmetadata set Authorization='" & Combo1.Text & "', Accesprivilage='" & Combo2.Text & "'  where datecreated ='" & Text6.Text & "'"
       
        
       ' sql = "update tblmetadata set agencyname='" & Text10.Text & "',Departmentname='" & Text11.Text & "',Fileclassification='" & Text12.Text & "',Pages='" & Text13.Text & "' where datecreated ='" & Text6.Text & "'"
       'sql = "update tblInitial_payment set AkaunSpecific = '" & AkaunSpecific & "' where id ='" & Text1.Text & "'"


    CN.Execute sql
    If Not CN Is Nothing Then
        If CN.State = adStateOpen Then CN.Close
    End If
    Set CN = Nothing
MsgBox "successfully Update", vbInformation, "status"


End If

End Sub

Private Sub Command9_Click()
Adodc1.RecordSource = "select * from tblmetadata "
        Adodc1.Refresh
        
        Adodc1.Recordset.AddNew
        Adodc1.Recordset!username = Mainsystem.StatusBar1.Panels(2).Text
        Adodc1.Recordset!FileName = Text2.Text
        Adodc1.Recordset!Directory = Text5.Text
        Adodc1.Recordset!Size = Text4.Text
        Adodc1.Recordset!Filetype = Text3.Text
        Adodc1.Recordset!DateCreated = Text6.Text
        Adodc1.Recordset!Datemodified = Text7.Text
        Adodc1.Recordset!Attribute = Text8.Text
        Adodc1.Recordset!PCname = Text9.Text
        Adodc1.Recordset!Agencyname = Text10.Text
        Adodc1.Recordset!Departmentname = Text11.Text
        Adodc1.Recordset!Fileclassification = Text12.Text
        Adodc1.Recordset!Pages = Text13.Text
        Adodc1.Recordset!Location = Combo1.Text
        Adodc1.Recordset!Accesprivilage = Combo2.Text
        Adodc1.Recordset!Ownerofrecords = Text14.Text
        Adodc1.Recordset!typeofrecords = Combo4.Text
        Adodc1.Recordset!Classifyrecords = Combo3.Text
        Adodc1.Recordset!Retentiondate = DTPicker2.Value
        Adodc1.Recordset!Remarks = Text15.Text
        
        
        
        
        Adodc1.Recordset.Update
        
        
MsgBox "Successfull Saved", vbInformation, "Status"
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Text13.Text = ""
Text14.Text = ""
Combo4.Text = ""
Combo3.Text = ""
Text15.Text = ""

End Sub

Private Sub Dir1_Change()
File1.FileName = Dir1.Path

End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_Click()
Dim fso As New FileSystemObject
Dim filesistem As File

Text2.Text = File1.FileName
Text5.Text = Dir1.Path

Set filesistem = fso.GetFile(Dir1.Path & "\" & File1.FileName)

Text3.Text = filesistem.Type
Text4.Text = filesistem.Size * 0.01
Text6.Text = filesistem.DateCreated
Text7.Text = filesistem.DateLastModified
Text8.Text = filesistem.Attributes
Text9.Text = ComputerName
End Sub

Private Sub Option1_Click()
If Option1.Value = True Then
            
        Else
            Exit Sub
        End If

End Sub

This post has been edited by AdamSpeight2008: 27 February 2011 - 06:18 AM

Was This Post Helpful? 0
  • +
  • -

#11 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: i want to open file from VB6

Posted 27 February 2011 - 06:16 AM

I think there was a misunderstanding from what I was asking you.

A couple of points.

1. Please post your code in the [ CODE ] tags (you can see them above the entry window when you're making a post). It makes your code more readable.
2. Please only post the code that relates to your issue, unless asked to post everything. Nobody is going to look through the amount of code you've posted, especially when you haven't told where the problem is (even more so in this case, as you've posted all the code and then said there is nothing in there relating to the ssTab).

Anyway, to get you started, have a look HERE.
Was This Post Helpful? 0
  • +
  • -

#12 Azrie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 25-February 11

Re: i want to open file from VB6

Posted 01 March 2011 - 09:56 PM

thanks buddy..i already solve the sstb problem..but can u help me more on to solve problem about the Adodc failed???ihave use the right adodc and link it at the right field of database..when i run n click button ok,they displayed syntax error...debug adodc failed...
Was This Post Helpful? 0
  • +
  • -

#13 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: i want to open file from VB6

Posted 01 March 2011 - 11:52 PM

Azrie, that's got to be some sort of record for posting lines of irrelevant code for people to go through. Even 110 lines of commented out code? In future, please go to the trouble of posting only the code that has the problem. Otherwise, you're asking us to do work that you ought to be doing, since you can.

Fair enough? :)
Was This Post Helpful? 0
  • +
  • -

#14 Azrie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 25-February 11

Re: i want to open file from VB6

Posted 02 March 2011 - 12:36 PM

hurm....ok..i have one problem just now...my File1.Then when i click on the file to select...they said
compile error: user define-type not define...then they highlight at the link Dim filesistem As File....why??before this i use same coding but have no any problem...

Private Sub File1_Click()
Dim fso As New FileSystemObject
Dim filesistem As file

Text6.Text = File1.FileName
Text9.Text = Dir1.Path

Set file = fso.GetFile(Dir1.Path & "\" & File1.FileName)

Text8.Text = file.DateCreated
Text7.Text = file.DateModified
Text17.Text = file.Size * 0.01
Text16.Text = file.FileFormat
Text18.Text = file.Attributes

Text19.Text = ComputerName
Was This Post Helpful? 0
  • +
  • -

#15 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: i want to open file from VB6

Posted 02 March 2011 - 04:44 PM

Much better, Azrie, thank you. The answer is that you have to tell VB that you want to use the library that has the code for the FileSystemObject class and related classes. To do this, go to Project/References and set a reference to "Microsoft Scripting Runtime". You'll see that the filename associated with it is "scrrun.dll" which is the file that contains these classes. See if that helps.
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3