Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Convert a VB6 project back to VB5
[ All Languages » VB »  IDE]

Total Hit ( 2338)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


If you load a VB6 project file in the VB5 environment you get a warning, even though the project is correctly loaded. The cause of the warning is a VB6 attribute "Retained" (that is, the "Retained in memory" option in the Project Properties dialog box) that isn't recognized by VB5. If you want to make a VB6 .vbp file backward campatibile with VB5 you can convert it using the following routine:

Click here to copy the following block
' Convert a VB6 VBP file so that it can be read
' into VB5 IDE without any error
'
' Returns True if successful,
' False if the project was already in VB5 format

Function ConvertVB6Project(ByVal filename As String) As Boolean
  Dim fnum As Long
  Dim fileText As String
  Dim i As Long
  
  fnum = FreeFile
  ' if the file doesn't exist, this statement raises an error
  Open filename For Input As #fnum
  ' read the entire fire and close it
  fileText = Input$(LOF(fnum), fnum)
  Close #fnum
  
  ' strip the "Retained" attribute
  ' we could easily delete it using the Replace function
  ' but we want this function to work under VB5 as well
  ' for obvious reasons
  i = InStr(1, fileText, "Retained=", vbTextCompare)
  ' if not found this is a VB5 project file
  If i = 0 Then Exit Function
  
  ' delete this line (account for the CRLF)
  fileText = Left$(fileText, i - 1) & Mid$(fileText, _
    i + Len("Retained=0") + 2)
  
  ' save to the same file
  Open filename For Output As #fnum
  Print #fnum, fileText;
  Close #fnum
  
  ' signal success
  ConvertVB6Project = True

End Function


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.