|
Hi Frnds..
I hv developed a Bill Contract Software in Vb.Net 2005(Windows application) , using vb as a language and msaccess as backend. I want to store all the data in the server. So i hv copied msaccess file to my personal domain inside wwwroot folder.
Now i dont want to store data in my PC. It should be stored in the server directly. Can anyone tell me what is the connection string for that...
Thank you...
|
|
|
|
|
Yes, it's a path to the mdb, across the network to the server machine.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks..
But plse tell me how to give the path..
|
|
|
|
|
hi
try looking in here...http://www.carlprothman.net/Default.aspx?tabid=81
|
|
|
|
|
hi,
simply create a log file, which store the path of your database.
Let me explain
first of all , make a form which ask from user for database path and set this form as startup form. Now at load event of this form check whether logfile(path.txt) is exist or not and perform action according to condition. I use following code in most appliction
If File.Exists(Application.StartupPath & "\Path.txt") Then<br />
FileClose(1)<br />
Dim s As String<br />
FileOpen(1, "path.txt", OpenMode.Input)<br />
Input(1, s)<br />
Dim FilePath As String<br />
FilePath = s<br />
TextBoxSetDatabasePath.Text = FilePath<br />
If File.Exists(FilePath) Then<br />
FilePath = FilePath.Substring(FilePath.LastIndexOf("\") + 1)<br />
If FilePath.Trim.ToUpper = "YOURDATABASENAME.MDB" Then<br />
DatabasePath = TextBoxSetDatabasePath.Text.Trim ' DatabasePath is global variable<br />
LoginForm1.Show()<br />
Me.Close()<br />
Else<br />
msgbox("Wrong database file. Please choose correct database file")<br />
End If<br />
<br />
Else<br />
msgbox(("Database file not found. Please choose the database file.")<br />
End If<br />
Else<br />
mdChecking.Prompt("Database Path not set. Please choose Database file.")<br />
End If
use databasepath varible value in connectionstring.
for prompt user to pick correct database file use following procedure
Try<br />
<br />
If TextBoxSetDatabasePath.Text <> "" Then<br />
If Not File.Exists(TextBoxSetDatabasePath.Text.Trim) Then<br />
mdChecking.Prompt("Incorrect database file. Please choose correct database file")<br />
Exit Sub<br />
Else<br />
Dim FilePath As String = TextBoxSetDatabasePath.Text.Trim<br />
<br />
FilePath = FilePath.Substring(FilePath.LastIndexOf("\") + 1)<br />
If FilePath.Trim.ToUpper = ""YOURDATABASENAME.MDB".MDB" Then<br />
DatabasePath = FilePath.Trim<br />
<br />
'If File.Exists(Application.StartupPath & "\path.txt") Then<br />
' File.Delete(Application.StartupPath & "\path.txt")<br />
'End If<br />
Dim s As String<br />
FileClose(1)<br />
s = Application.StartupPath & "\path.txt"<br />
FileOpen(1, s, OpenMode.Output)<br />
WriteLine(1, TextBoxSetDatabasePath.Text)<br />
<br />
FileClose(1)<br />
LoginForm1.Show()<br />
Me.Close()<br />
Else<br />
msgbox("Wrong database file. Please choose correct database file")<br />
End If<br />
<br />
End If<br />
Else<br />
msgbox("Database path is not set. Please choose database file")<br />
End If<br />
Catch ex As Exception<br />
MsgBox(ex.Message, MsgBoxStyle.Information, Me.Text)<br />
End Try
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Well, you have a small problem. You can't connect to an Access database on the other side of a web server. Access is a file-based desktop database, not an SQL Server. It will only work if the user running your app can see the database file through a Windows Share, AND the user has read and write access to that share. Normally, noone gets those kind of permissions if the file is in the wwwroot folder or below.
|
|
|
|
|
Thanks..
Thanks for everyone..
I got the solution..
|
|
|
|
|
Hi,
For "DatetimePicker" control, I gave format as customFormat(MM/dd/yy hh:mm:ss).
When i run the application for first time it is working fine (displaying current date and time), but when i select another date the time is not updating.
Please advise me to achieve this or any other control for date and time.
|
|
|
|
|
lingareddy wrote: but when i select another date the time is not updating.
You'll have to explain this. Since you just changed the date in the control, why should the time update?? You haven't changed it in the control, or have you??
|
|
|
|
|
your question is little bit confusing. it shows the time for the current date. how would you expect to get the time from the past or in future to display with the date you have given as input. have you done something with time or have any link between the date and time
thanks,
Mohanraj D
RAJA
|
|
|
|
|
halo..
I want to send email to my account but this program run twice. So,after click on submit button, 2 same mails send to my account.How this could happen?
Thanks.
<code><small>Imports System.Net.Mail
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
Try
Dim message As New MailMessage(txtTo.Text, txtFrom.Text, txtSubject.Text, txtBody.Text)
Dim emailClient As New SmtpClient(txtSMTPServer.Text)
emailClient.Send(message)
litStatus.Text = "Message Sent"
Catch ex As Exception
litStatus.Text = ex.ToString()
End Try
End Sub
End Class</small></code>
|
|
|
|
|
You're looking for the ASP.NET Forum, not the VB.NET forum.
You may want to post the code you have in the Load event handler there. It sounds like you're not handling Postback properly.
|
|
|
|
|
Greetings,
I am attempting to write a program to print a label with variable input from the user. As you can see, it offers the chance to create a bar code. However, I am using visual basic express 2008 (it is the only version I have found and I am not eager to install another one just yet).
I have mad errors.. Look in the comments to see what I am talking about. Does anyone have suggestions as to how I can print my barcode?
Public Class Form1
'Put this code at a module.
'Usage: PaintCodeBar39 Printer, Xpos, Ypos, BarsHeight, WidthFactor, Text, HumanRead
' Printer.EndDoc
Public Structure C39
char As String * 1
'************ SYNTAX ERROR ABOVE***********'
Dim bar(1 To 5) As Boolean
' This threw 2 errors'
'****ERROR 2 Arrays declared as structure members cannot be declared with an initial size.****** '
'****ERROR 3 Array lower bounds can be only '0'.
Dim spe(1 To 5) As Boolean ' 5th space for character gap
End Structure
Dim CODE39(43) As C39
Sub InitArray()
CODE39(0).char = "0"
CODE39(0).bar(1) = False
CODE39(0).spe(1) = False
CODE39(0).bar(2) = False
CODE39(0).spe(2) = True
CODE39(0).bar(3) = True
CODE39(0).spe(3) = False
CODE39(0).bar(4) = True
CODE39(0).spe(4) = False
CODE39(0).bar(5) = False
CODE39(0).spe(5) = False
CODE39(1).char = "1"
CODE39(1).bar(1) = True
CODE39(1).spe(1) = False
CODE39(1).bar(2) = False
CODE39(1).spe(2) = True
CODE39(1).bar(3) = False
CODE39(1).spe(3) = False
CODE39(1).bar(4) = False
CODE39(1).spe(4) = False
CODE39(1).bar(5) = True
CODE39(1).spe(5) = False
CODE39(2).char = "2"
CODE39(2).bar(1) = False
CODE39(2).spe(1) = False
CODE39(2).bar(2) = True
CODE39(2).spe(2) = True
CODE39(2).bar(3) = False
CODE39(2).spe(3) = False
CODE39(2).bar(4) = False
CODE39(2).spe(4) = False
CODE39(2).bar(5) = True
CODE39(2).spe(5) = False
CODE39(3).char = "3"
CODE39(3).bar(1) = True
CODE39(3).spe(1) = False
CODE39(3).bar(2) = True
CODE39(3).spe(2) = True
CODE39(3).bar(3) = False
CODE39(3).spe(3) = False
CODE39(3).bar(4) = False
CODE39(3).spe(4) = False
CODE39(3).bar(5) = False
CODE39(3).spe(5) = False
CODE39(4).char = "4"
CODE39(4).bar(1) = False
CODE39(4).spe(1) = False
CODE39(4).bar(2) = False
CODE39(4).spe(2) = True
CODE39(4).bar(3) = True
CODE39(4).spe(3) = False
CODE39(4).bar(4) = False
CODE39(4).spe(4) = False
CODE39(4).bar(5) = True
CODE39(4).spe(5) = False
CODE39(5).char = "5"
CODE39(5).bar(1) = True
CODE39(5).spe(1) = False
CODE39(5).bar(2) = False
CODE39(5).spe(2) = True
CODE39(5).bar(3) = True
CODE39(5).spe(3) = False
CODE39(5).bar(4) = False
CODE39(5).spe(4) = False
CODE39(5).bar(5) = False
CODE39(5).spe(5) = False
CODE39(6).char = "6"
CODE39(6).bar(1) = False
CODE39(6).spe(1) = False
CODE39(6).bar(2) = True
CODE39(6).spe(2) = True
CODE39(6).bar(3) = True
CODE39(6).spe(3) = False
CODE39(6).bar(4) = False
CODE39(6).spe(4) = False
CODE39(6).bar(5) = False
CODE39(6).spe(5) = False
CODE39(7).char = "7"
CODE39(7).bar(1) = False
CODE39(7).spe(1) = False
CODE39(7).bar(2) = False
CODE39(7).spe(2) = True
CODE39(7).bar(3) = False
CODE39(7).spe(3) = False
CODE39(7).bar(4) = True
CODE39(7).spe(4) = False
CODE39(7).bar(5) = True
CODE39(7).spe(5) = False
CODE39(8).char = "8"
CODE39(8).bar(1) = True
CODE39(8).spe(1) = False
CODE39(8).bar(2) = False
CODE39(8).spe(2) = True
CODE39(8).bar(3) = False
CODE39(8).spe(3) = False
CODE39(8).bar(4) = True
CODE39(8).spe(4) = False
CODE39(8).bar(5) = False
CODE39(8).spe(5) = False
CODE39(9).char = "9"
CODE39(9).bar(1) = False
CODE39(9).spe(1) = False
CODE39(9).bar(2) = True
CODE39(9).spe(2) = True
CODE39(9).bar(3) = False
CODE39(9).spe(3) = False
CODE39(9).bar(4) = True
CODE39(9).spe(4) = False
CODE39(9).bar(5) = False
CODE39(9).spe(5) = False
CODE39(10).char = "A"
CODE39(10).bar(1) = True
CODE39(10).spe(1) = False
CODE39(10).bar(2) = False
CODE39(10).spe(2) = False
CODE39(10).bar(3) = False
CODE39(10).spe(3) = True
CODE39(10).bar(4) = False
CODE39(10).spe(4) = False
CODE39(10).bar(5) = True
CODE39(10).spe(5) = False
CODE39(11).char = "B"
CODE39(11).bar(1) = False
CODE39(11).spe(1) = False
CODE39(11).bar(2) = True
CODE39(11).spe(2) = False
CODE39(11).bar(3) = False
CODE39(11).spe(3) = True
CODE39(11).bar(4) = False
CODE39(11).spe(4) = False
CODE39(11).bar(5) = True
CODE39(11).spe(5) = False
CODE39(12).char = "C"
CODE39(12).bar(1) = True
CODE39(12).spe(1) = False
CODE39(12).bar(2) = True
CODE39(12).spe(2) = False
CODE39(12).bar(3) = False
CODE39(12).spe(3) = True
CODE39(12).bar(4) = False
CODE39(12).spe(4) = False
CODE39(12).bar(5) = False
CODE39(12).spe(5) = False
CODE39(13).char = "D"
CODE39(13).bar(1) = False
CODE39(13).spe(1) = False
CODE39(13).bar(2) = False
CODE39(13).spe(2) = False
CODE39(13).bar(3) = True
CODE39(13).spe(3) = True
CODE39(13).bar(4) = False
CODE39(13).spe(4) = False
CODE39(13).bar(5) = True
CODE39(13).spe(5) = False
CODE39(14).char = "E"
CODE39(14).bar(1) = True
CODE39(14).spe(1) = False
CODE39(14).bar(2) = False
CODE39(14).spe(2) = False
CODE39(14).bar(3) = True
CODE39(14).spe(3) = True
CODE39(14).bar(4) = False
CODE39(14).spe(4) = False
CODE39(14).bar(5) = False
CODE39(14).spe(5) = False
CODE39(15).char = "F"
CODE39(15).bar(1) = False
CODE39(15).spe(1) = False
CODE39(15).bar(2) = True
CODE39(15).spe(2) = False
CODE39(15).bar(3) = True
CODE39(15).spe(3) = True
CODE39(15).bar(4) = False
CODE39(15).spe(4) = False
CODE39(15).bar(5) = False
CODE39(15).spe(5) = False
CODE39(16).char = "G"
CODE39(16).bar(1) = False
CODE39(16).spe(1) = False
CODE39(16).bar(2) = False
CODE39(16).spe(2) = False
CODE39(16).bar(3) = False
CODE39(16).spe(3) = True
CODE39(16).bar(4) = True
CODE39(16).spe(4) = False
CODE39(16).bar(5) = True
CODE39(16).spe(5) = False
CODE39(17).char = "H"
CODE39(17).bar(1) = True
CODE39(17).spe(1) = False
CODE39(17).bar(2) = False
CODE39(17).spe(2) = False
CODE39(17).bar(3) = False
CODE39(17).spe(3) = True
CODE39(17).bar(4) = True
CODE39(17).spe(4) = False
CODE39(17).bar(5) = False
CODE39(17).spe(5) = False
CODE39(18).char = "I"
CODE39(18).bar(1) = False
CODE39(18).spe(1) = False
CODE39(18).bar(2) = True
CODE39(18).spe(2) = False
CODE39(18).bar(3) = False
CODE39(18).spe(3) = True
CODE39(18).bar(4) = True
CODE39(18).spe(4) = False
CODE39(18).bar(5) = False
CODE39(18).spe(5) = False
CODE39(19).char = "J"
CODE39(19).bar(1) = False
CODE39(19).spe(1) = False
CODE39(19).bar(2) = False
CODE39(19).spe(2) = False
CODE39(19).bar(3) = True
CODE39(19).spe(3) = True
CODE39(19).bar(4) = True
CODE39(19).spe(4) = False
CODE39(19).bar(5) = False
CODE39(19).spe(5) = False
CODE39(20).char = "K"
CODE39(20).bar(1) = True
CODE39(20).spe(1) = False
CODE39(20).bar(2) = False
CODE39(20).spe(2) = False
CODE39(20).bar(3) = False
CODE39(20).spe(3) = False
CODE39(20).bar(4) = False
CODE39(20).spe(4) = True
CODE39(20).bar(5) = True
CODE39(20).spe(5) = False
CODE39(21).char = "L"
CODE39(21).bar(1) = False
CODE39(21).spe(1) = False
CODE39(21).bar(2) = True
CODE39(21).spe(2) = False
CODE39(21).bar(3) = False
CODE39(21).spe(3) = False
CODE39(21).bar(4) = False
CODE39(21).spe(4) = True
CODE39(21).bar(5) = True
CODE39(21).spe(5) = False
CODE39(22).char = "M"
CODE39(22).bar(1) = True
CODE39(22).spe(1) = False
CODE39(22).bar(2) = True
CODE39(22).spe(2) = False
CODE39(22).bar(3) = False
CODE39(22).spe(3) = False
CODE39(22).bar(4) = False
CODE39(22).spe(4) = True
CODE39(22).bar(5) = False
CODE39(22).spe(5) = False
CODE39(23).char = "N"
CODE39(23).bar(1) = False
CODE39(23).spe(1) = False
CODE39(23).bar(2) = False
CODE39(23).spe(2) = False
CODE39(23).bar(3) = True
CODE39(23).spe(3) = False
CODE39(23).bar(4) = False
CODE39(23).spe(4) = True
CODE39(23).bar(5) = True
CODE39(23).spe(5) = False
CODE39(24).char = "O"
CODE39(24).bar(1) = True
CODE39(24).spe(1) = False
CODE39(24).bar(2) = False
CODE39(24).spe(2) = False
CODE39(24).bar(3) = True
CODE39(24).spe(3) = False
CODE39(24).bar(4) = False
CODE39(24).spe(4) = True
CODE39(24).bar(5) = False
CODE39(24).spe(5) = False
CODE39(25).char = "P"
CODE39(25).bar(1) = False
CODE39(25).spe(1) = False
CODE39(25).bar(2) = True
CODE39(25).spe(2) = False
CODE39(25).bar(3) = True
CODE39(25).spe(3) = False
CODE39(25).bar(4) = False
CODE39(25).spe(4) = True
CODE39(25).bar(5) = False
CODE39(25).spe(5) = False
CODE39(26).char = "Q"
CODE39(26).bar(1) = False
CODE39(26).spe(1) = False
CODE39(26).bar(2) = False
CODE39(26).spe(2) = False
CODE39(26).bar(3) = False
CODE39(26).spe(3) = False
CODE39(26).bar(4) = True
CODE39(26).spe(4) = True
CODE39(26).bar(5) = True
CODE39(26).spe(5) = False
CODE39(27).char = "R"
CODE39(27).bar(1) = True
CODE39(27).spe(1) = False
CODE39(27).bar(2) = False
CODE39(27).spe(2) = False
CODE39(27).bar(3) = False
CODE39(27).spe(3) = False
CODE39(27).bar(4) = True
CODE39(27).spe(4) = True
CODE39(27).bar(5) = False
CODE39(27).spe(5) = False
CODE39(28).char = "S"
CODE39(28).bar(1) = False
CODE39(28).spe(1) = False
CODE39(28).bar(2) = True
CODE39(28).spe(2) = False
CODE39(28).bar(3) = False
CODE39(28).spe(3) = False
CODE39(28).bar(4) = True
CODE39(28).spe(4) = True
CODE39(28).bar(5) = False
CODE39(28).spe(5) = False
CODE39(29).char = "T"
CODE39(29).bar(1) = False
CODE39(29).spe(1) = False
CODE39(29).bar(2) = False
CODE39(29).spe(2) = False
CODE39(29).bar(3) = True
CODE39(29).spe(3) = False
CODE39(29).bar(4) = True
CODE39(29).spe(4) = True
CODE39(29).bar(5) = False
CODE39(29).spe(5) = False
CODE39(30).char = "U"
CODE39(30).bar(1) = True
CODE39(30).spe(1) = True
CODE39(30).bar(2) = False
CODE39(30).spe(2) = False
CODE39(30).bar(3) = False
CODE39(30).spe(3) = False
CODE39(30).bar(4) = False
CODE39(30).spe(4) = False
CODE39(30).bar(5) = True
CODE39(30).spe(5) = False
CODE39(31).char = "V"
CODE39(31).bar(1) = False
CODE39(31).spe(1) = True
CODE39(31).bar(2) = True
CODE39(31).spe(2) = False
CODE39(31).bar(3) = False
CODE39(31).spe(3) = False
CODE39(31).bar(4) = False
CODE39(31).spe(4) = False
CODE39(31).bar(5) = True
CODE39(31).spe(5) = False
CODE39(32).char = "W"
CODE39(32).bar(1) = True
CODE39(32).spe(1) = True
CODE39(32).bar(2) = True
CODE39(32).spe(2) = False
CODE39(32).bar(3) = False
CODE39(32).spe(3) = False
CODE39(32).bar(4) = False
CODE39(32).spe(4) = False
CODE39(32).bar(5) = False
CODE39(32).spe(5) = False
CODE39(33).char = "X"
CODE39(33).bar(1) = False
CODE39(33).spe(1) = True
CODE39(33).bar(2) = False
CODE39(33).spe(2) = False
CODE39(33).bar(3) = True
CODE39(33).spe(3) = False
CODE39(33).bar(4) = False
CODE39(33).spe(4) = False
CODE39(33).bar(5) = True
CODE39(33).spe(5) = False
CODE39(34).char = "Y"
CODE39(34).bar(1) = True
CODE39(34).spe(1) = True
CODE39(34).bar(2) = False
CODE39(34).spe(2) = False
CODE39(34).bar(3) = True
CODE39(34).spe(3) = False
CODE39(34).bar(4) = False
CODE39(34).spe(4) = False
CODE39(34).bar(5) = False
CODE39(34).spe(5) = False
CODE39(35).char = "Z"
CODE39(35).bar(1) = False
CODE39(35).spe(1) = True
CODE39(35).bar(2) = True
CODE39(35).spe(2) = False
CODE39(35).bar(3) = True
CODE39(35).spe(3) = False
CODE39(35).bar(4) = False
CODE39(35).spe(4) = False
CODE39(35).bar(5) = False
CODE39(35).spe(5) = False
CODE39(36).char = "-"
CODE39(36).bar(1) = False
CODE39(36).spe(1) = True
CODE39(36).bar(2) = False
CODE39(36).spe(2) = False
CODE39(36).bar(3) = False
CODE39(36).spe(3) = False
CODE39(36).bar(4) = True
CODE39(36).spe(4) = False
CODE39(36).bar(5) = True
CODE39(36).spe(5) = False
CODE39(37).char = "."
CODE39(37).bar(1) = True
CODE39(37).spe(1) = True
CODE39(37).bar(2) = False
CODE39(37).spe(2) = False
CODE39(37).bar(3) = False
CODE39(37).spe(3) = False
CODE39(37).bar(4) = True
CODE39(37).spe(4) = False
CODE39(37).bar(5) = False
CODE39(37).spe(5) = False
CODE39(38).char = " "
CODE39(38).bar(1) = False
CODE39(38).spe(1) = True
CODE39(38).bar(2) = True
CODE39(38).spe(2) = False
CODE39(38).bar(3) = False
CODE39(38).spe(3) = False
CODE39(38).bar(4) = True
CODE39(38).spe(4) = False
CODE39(38).bar(5) = False
CODE39(38).spe(5) = False
CODE39(39).char = "$"
CODE39(39).bar(1) = False
CODE39(39).spe(1) = True
CODE39(39).bar(2) = False
CODE39(39).spe(2) = True
CODE39(39).bar(3) = False
CODE39(39).spe(3) = True
CODE39(39).bar(4) = False
CODE39(39).spe(4) = False
CODE39(39).bar(5) = False
CODE39(39).spe(5) = False
CODE39(40).char = "/"
CODE39(40).bar(1) = False
CODE39(40).spe(1) = True
CODE39(40).bar(2) = False
CODE39(40).spe(2) = True
CODE39(40).bar(3) = False
CODE39(40).spe(3) = False
CODE39(40).bar(4) = False
CODE39(40).spe(4) = True
CODE39(40).bar(5) = False
CODE39(40).spe(5) = False
CODE39(41).char = "+"
CODE39(41).bar(1) = False
CODE39(41).spe(1) = True
CODE39(41).bar(2) = False
CODE39(41).spe(2) = False
CODE39(41).bar(3) = False
CODE39(41).spe(3) = True
CODE39(41).bar(4) = False
CODE39(41).spe(4) = True
CODE39(41).bar(5) = False
CODE39(41).spe(5) = False
CODE39(42).char = "%"
CODE39(42).bar(1) = False
CODE39(42).spe(1) = False
CODE39(42).bar(2) = False
CODE39(42).spe(2) = True
CODE39(42).bar(3) = False
CODE39(42).spe(3) = True
CODE39(42).bar(4) = False
CODE39(42).spe(4) = True
CODE39(42).bar(5) = False
CODE39(42).spe(5) = False
CODE39(43).char = "*"
CODE39(43).bar(1) = False
CODE39(43).spe(1) = True
CODE39(43).bar(2) = False
CODE39(43).spe(2) = False
CODE39(43).bar(3) = True
CODE39(43).spe(3) = False
CODE39(43).bar(4) = True
CODE39(43).spe(4) = False
CODE39(43).bar(5) = False
CODE39(43).spe(5) = False
End Sub
Sub PaintCodeBar39(ByVal PictObj As Object, ByVal x, ByVal y, ByVal h, ByVal wf, ByVal text As String, ByVal tf)
InitArray()
PictObj.ScaleMode = 3
PictObj.CurrentX = x
PictObj.CurrentY = y
xpos = x
ypos = y
text = Trim(text)
For j = 1 To Len(text)
d = Mid(text, j, 1)
N39 = AscTo39(d)
If tf Then
PictObj.CurrentX = xpos + (16 * wf - PictObj.TextWidth(d)) / 2
PictObj.CurrentY = y + h
PictObj.Print(d)
End If
'Plot 5 bars and 4 spaces and gap
For bs = 1 To 5
'Bar
If CODE39(N39).bar(bs) Then
w = 3 'Wide
Else
w = 1 'Narrow
End If
'Draw line for bar
For i = 1 To w * wf
PictObj.Line (xpos, ypos)-(xpos, ypos + h)
xpos = xpos + 1
Next
'Space
If CODE39(N39).spe(bs) Then
xpos = xpos + 3 * wf 'Wide
Else
xpos = xpos + 1 * wf 'Narrow
End If
Next
Next
End Sub
Function AscTo39(ByVal c)
AscTo39 = -1
If c >= "0" And c <= "9" Then
AscTo39 = Val(c)
Else
c = UCase(c)
If c >= "A" And c <= "Z" Then
AscTo39 = Asc(c) - 55
Else
Select Case c
Case "-"
AscTo39 = 36
Case "."
AscTo39 = 37
Case " "
AscTo39 = 38
Case "*"
AscTo39 = 43
Case "$"
AscTo39 = 39
Case "/"
AscTo39 = 40
Case "+"
AscTo39 = 41
Case "%"
AscTo39 = 42
End Select
End If
End If
End Function
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
PaintCodeBar39(Printer, 0, 0, 50, 2, "*ABCDE*", True)
Printer.EndDoc()
End Sub
Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
PaintCodeBar39(Printer, 0, 0, 50, 2, "*ABCDE*", True)
Printer.EndDoc()
End Sub
End Class
A SUMMARY OF ALL ERROR MESSAGES
Error 1 Syntax error. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 7 5 PClabel
Error 2 Arrays declared as structure members cannot be declared with an initial size. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 8 9 PClabel
Error 3 Array lower bounds can be only '0'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 8 13 PClabel
Error 4 Arrays declared as structure members cannot be declared with an initial size. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 9 9 PClabel
Error 5 Array lower bounds can be only '0'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 9 13 PClabel
Error 6 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 15 9 PClabel
Error 7 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 26 9 PClabel
Error 8 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 37 9 PClabel
Error 9 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 48 9 PClabel
Error 10 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 59 9 PClabel
Error 11 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 70 9 PClabel
Error 12 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 81 9 PClabel
Error 13 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 92 9 PClabel
Error 14 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 103 9 PClabel
Error 15 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 114 9 PClabel
Error 16 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 125 9 PClabel
Error 17 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 136 9 PClabel
Error 18 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 147 9 PClabel
Error 19 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 158 9 PClabel
Error 20 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 169 9 PClabel
Error 21 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 180 9 PClabel
Error 22 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 191 9 PClabel
Error 23 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 202 9 PClabel
Error 24 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 213 9 PClabel
Error 25 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 224 9 PClabel
Error 26 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 235 9 PClabel
Error 27 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 246 9 PClabel
Error 28 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 257 9 PClabel
Error 29 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 268 9 PClabel
Error 30 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 279 9 PClabel
Error 31 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 290 9 PClabel
Error 32 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 301 9 PClabel
Error 33 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 312 9 PClabel
Error 34 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 323 9 PClabel
Error 35 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 334 9 PClabel
Error 36 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 345 9 PClabel
Error 37 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 356 9 PClabel
Error 38 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 367 9 PClabel
Error 39 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 378 9 PClabel
Error 40 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 389 9 PClabel
Error 41 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 400 9 PClabel
Error 42 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 411 9 PClabel
Error 43 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 422 9 PClabel
Error 44 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 433 9 PClabel
Error 45 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 444 9 PClabel
Error 46 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 455 9 PClabel
Error 47 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 466 9 PClabel
Error 48 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 477 9 PClabel
Error 49 'char' is not a member of 'PClabel.Form1.C39'. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 488 9 PClabel
Error 50 All parameters must be explicitly typed if any of them are explicitly typed. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 501 55 PClabel
Error 51 All parameters must be explicitly typed if any of them are explicitly typed. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 501 64 PClabel
Error 52 All parameters must be explicitly typed if any of them are explicitly typed. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 501 73 PClabel
Error 53 All parameters must be explicitly typed if any of them are explicitly typed. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 501 82 PClabel
Error 54 All parameters must be explicitly typed if any of them are explicitly typed. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 501 114 PClabel
Error 55 Name 'xpos' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 509 9 PClabel
Error 56 Name 'ypos' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 510 9 PClabel
Error 57 Name 'd' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 515 13 PClabel
Error 58 Name 'N39' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 516 13 PClabel
Error 59 Name 'd' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 516 27 PClabel
Error 60 Name 'xpos' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 518 36 PClabel
Error 61 Name 'd' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 518 72 PClabel
Error 62 Name 'd' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 520 31 PClabel
Error 63 Name 'N39' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 525 27 PClabel
Error 64 Name 'w' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 526 21 PClabel
Error 65 Name 'w' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 528 21 PClabel
Error 66 Name 'w' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 531 30 PClabel
Error 67 Name 'xpos' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 532 31 PClabel
Error 68 Name 'ypos' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 532 37 PClabel
Error 69 End of statement expected. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 532 42 PClabel
Error 70 Name 'xpos' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 533 21 PClabel
Error 71 Name 'xpos' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 533 28 PClabel
Error 72 Name 'N39' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 536 27 PClabel
Error 73 Name 'xpos' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 537 21 PClabel
Error 74 Name 'xpos' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 537 28 PClabel
Error 75 Name 'xpos' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 539 21 PClabel
Error 76 Name 'xpos' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 539 28 PClabel
Error 77 Name 'Printer' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 583 24 PClabel
Error 78 Name 'Printer' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 584 9 PClabel
Error 79 Name 'Printer' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 588 24 PClabel
Error 80 Name 'Printer' is not declared. C:\Users\Dad\AppData\Local\Temporary Projects\PClabel\Form1.vb 589 9 PClabel
-Live long and prosper
|
|
|
|
|
winsane wrote: Dim bar(1 To 5) As Boolean
I think it's dim bar() as Boolean(5)
winsane wrote: If CODE39(N39).bar(bs) Then
This is too much code to read, what is N39 ? A variable, I assume ?
You have the same errors over and over, if you just posted the lines that give each error with the error, that would be easier.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Why does this look like VB6 code you tried to convert to VB.NET??
|
|
|
|
|
Dave Kreskowiak wrote: Why does this look like VB6 code you tried to convert to VB.NET?
Because it is just a VB6 module pasted in a VB.NET form. I wouldn't really call that an attempt to convert it...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
For the purposes of this question, I believe it conveys whta I am trying to gt my program to do. This chunk of code is not my finished product, it is something I am using as a basis for a new class in an even bigger program. It is like looking at a sketch to create a painting.
-Live long and prosper
|
|
|
|
|
Then why did you try to compile the sketch?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
It is a chunk of code that I purloined from a tutorial. I am trying to take what is usable and improvise the rest.
-Live long and prosper
|
|
|
|
|
You can't just paste VB6 code in a VB.NET form and expect it to work. The code uses some constructs that doesn't exist in VB any more. VB went through a major change with version 7, becoming an object oriented language using the .NET framework. You are using VB 9 now.
You have to rewrite the code to VB.NET. Here are some pointers:
:: Don't use a structure, use a class.
:: VB.NET has a real Char type, you don't have to use a one character string.
:: Don't use "char" as a member name, as it's now a data type.
:: Declare all variables that you use, and specify a data type for them.
Regarding your error messages; most of the errors are results of the first five errors.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I can not seem to find how to have the code search the print server for ALL network printers and map all of them on a computer. Any ideas on this? I know how to map them one by one, but I want it to map all the printers to the computer that are on the print server.
|
|
|
|
|
Are the printers published in Active Directory?? TechNet: List All Published Printers[^]
If not, and in a domain environment, you'll have to use WMI to query the server computer for it's list of shared printers. You'll need to query WMI's Win32_Share class, where the share's Type is 1. This denotes a share as being a shared print queue. The share name of each printer will be returned in the Win32_Share class' Caption property.
See the TechNet Script Repository[^] for examples using WMI.
|
|
|
|
|
Hello,
I have an older application that uses VB .NET with XCreed Grids and MS Access. I want to convert it so the backend uses SQL Server instead of MS Access.
Do I have to make lot of changes or I can just change the connection string in the Global file?
Anybody has done things like this before?
Thanks,
Ekjon
|
|
|
|
|
Change the connection string, then work through, there could well be SQL differences you need to address, the SQL dialects are not identical
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|