borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (how to get shape object in Word and saved it to file .jpg by using vb.net coding?)Next Topic (how to upadte REcord from datagrid??) New Topic New Poll Post Reply
AndreaVB Forum : VB.Net : Publishing worries
Poster Message
nubs
Level: Trainee

Registered: 15-07-2005
Posts: 2

icon Publishing worries

Hello newbie here! I'm a student working on a small project with Visual Basic Express. I'm about finishing my project and been trying to publish it to a CD. This project contains labels which read data from text files stored in the bin directory and a login database. But I dont know how these are added to the deployed program. Tried adding to prequisites and applicatiosn or resources but wouldn't work. On running the deployed program, it can't find the pathway of the database nor ext files as they are wrong and the bin directory isn't deployed with program. So OLEDB connection to login database.
   This may sound easy but help highly appreciated please! Thanks.

15-07-2005 at 08:02 AM
View Profile Send Email to User Show All Posts | Quote Reply
Chris_871
Level: Master


Registered: 30-11-2002
Posts: 106
icon Re: Publishing worries

Hi

When you deploy your application,  all the related files including the exe file copied into the folder which you have selected for installation. So you can't refer your file from the BIN folder. Use the following sample it may help you.

strpath = Environment.CurrentDirectory

strPath = strPath & "\dbconnection.txt"



Regards

Chris



15-07-2005 at 09:33 AM
View Profile Send Email to User Show All Posts | Quote Reply
nubs
Level: Trainee

Registered: 15-07-2005
Posts: 2
icon Re: Publishing worries

Cheers, that was useful. The problem with my program is when it is deployed. I'm using VB Express 2005 Beta. I have a error checker that's a statement which check it file has been found the loads it into the label else returns a statement indicating an error and shows where the file is expected to be.
When the application is published, on running it the files cannot be located and program indicates they are stored in some temporary folders of the Local Settings folder of the PC hard drive.  This is weird, i dont know why and where the deployement puts the files and why it does not read from the application current directory. This my code:
        Dim FILE_NAME As String = Environment.CurrentDirectory
        FILE_NAME = FILE_NAME & "\file.txt"
        Dim TextLine As String = ""

        If System.IO.File.Exists(FILE_NAME) = True Then
            Dim objReader As New System.IO.StreamReader(FILE_NAME)
            Do While objReader.Peek() <> -1
                TextLine = TextLine & objReader.ReadLine() & vbNewLine
            Loop
            Label5.Text = TextLine
        Else
            MsgBox("Runtime Error. " & Chr(13) & Chr(10) & FILE_NAME)
        End If

Or how do i change the settings to it deploys the files to the folder selected for installation? Thanks.

18-07-2005 at 01:00 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB.Net : Publishing worries
Previous Topic (how to get shape object in Word and saved it to file .jpg by using vb.net coding?)Next Topic (how to upadte REcord from datagrid??) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder