|
You could use an Access database to do this, though Access was not designed for a multiuser environment. You WILL have to do maintenance on the database and Compact and Repair it every now and again. You WILL eventually have problems with the database.
If you want less problems and more flexibility, go with an SQL Server version, such Sql Server Express (free!).
Since Access is a file-based database, every user will have to have access rights to the file share and folder on the server where the database will be stored. I hope you know what you're doing when it comes to Windows Networking. If you don't, then you better learn before you start this project. You WILL need to know this stuff.
|
|
|
|
|
Hello,
I have a function ConnectTo in a class clsMakeConnection.
My code is:
Dim MyCon as new clsMakeConnection()
MyCon.ConnectTo(...)
I would like to get a list of the possible connections.
I mean the list that you get when for example you write:
Dim c as color=
and then you get a list of all the colors as following
Color.AliceBlue
Color.Blue
Color.White
...
Is it possible to do that?
Thank you
Shay Noy
|
|
|
|
|
There's several ways of doing this. The most basic is creating an Enum to provide this list of options. But, in all cases, it isn't magically created for you.
Public Enum ConnectionOptions As Integer
SomeOption = someIntegerValue
SomeOtherOption = someOtherIntegerValue
... and so on for each option ...
End Enum
Then, in your method signature of your Connection class:
Public Class clsMakeConnection
Public Function ConnectTo(ByVal connectionType As ConnectionOptions) As ...
|
|
|
|
|
|
Is it possible in addition to set a tooltip for each one of the items?
Someone can help?
Shay Noy
modified on Thursday, December 20, 2007 4:49:26 AM
|
|
|
|
|
Hello, everyone
I am using VB.NET 2005 to create a project try to monite the PLC device. This project need to send a ASCII string to PLC link <enq>00FFBRAM00001422. I create this string in my program and using SerialPort object to control RS-232 port. I wrote the following code
RS232PORT = NEW system.io.pORT ( "COM6" , 9600 , ....)
RS232PORT.OPEN()...........................This stament execute sucessfull , means RS232port define is ok,
.....
mStr1 = chr(05) & "00FFBRAM00001422"
RS232PORT.WRITE( mstr1 )
and I found the RS-232 port flesh and PLC recive LED also flesh one. But PLC return with nothing. I got another utility and open another com port said COM3, and have null modem connected COM3 & COM6 and RS-232 test utility shows it got a data with 63 5 63 30 63 30 63 46 63 46..... it seems a x63 was added for each character, I wounder why ?
I check the menu say , SerialPort object default use encoding.ASCII format to send data , but why the result seems not,
following is my serial port object setting
? rs232port
{System.IO.Ports.SerialPort}
BaseStream: {System.IO.Ports.SerialStream}
BaudRate: 9600
BreakState: False
BytesToRead: 0
BytesToWrite: 0
CDHolding: False
Container: {System.ComponentModel.Container}
CtsHolding: False
DataBits: 7
DiscardNull: False
DsrHolding: False
DtrEnable: False
Encoding: {System.Text.ASCIIEncoding}
Handshake: None {0}
InfiniteTimeout: -1
IsOpen: True
NewLine: "
"
Parity: Odd {1}
ParityReplace: 63
PortName: "COM6"
ReadBufferSize: 4096
ReadTimeout: -1
ReceivedBytesThreshold: 1
RtsEnable: False
Site: {System.ComponentModel.Container.Site}
StopBits: One {1}
WriteBufferSize: 2048
WriteTimeout: -1
can anyone know where I should change to send data string to PLC normally.
Best regards
Robert
|
|
|
|
|
Hi Robert,
my personal experience with SerialPort is limited to byte[] communication, I haven't sent
strings yet. But you are not the first to ask similar questions here, from earlier posts
I have got the impression setting the Encoding explicitly once again, maybe after opening
the port, could be useful.
|
|
|
|
|
Hi all,
I am using a picturebox and i am loading Image by means of
PictureBox1.Image=image.FromFile("filepath and name")
if i want to remove the picture using fso.DeleteFile(paths, True) function. i cant able to delete. it show Access Denied error.
Can you give any idea to solve i,e. remove the image from the picture box after it load by using some delte method???
Thanks in advance
Senthil S
Software Engineer
|
|
|
|
|
Senthil S wrote: I am using a picturebox and i am loading Image by means of
PictureBox1.Image=image.FromFile("filepath and name")
if i want to remove the picture using fso.DeleteFile(paths, True) function. i cant able to delete. it show Access Denied error.
Can you give any idea to solve i,e. remove the image from the picture box after it load by using some delte method???
Using FromFile will not let you delete the file... try some other method of loading the picture into your picture box.
|
|
|
|
|
You need to load the image, make a copy and dispose of the original. That's a bug in GDI+
Why would you delete it while the picturebox is trying to show it tho ?
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
I feel a PictureBox.CreateGraphics and an Image.Save coming up. DId you have to ask?
|
|
|
|
|
hi guys
unverifiable code failed policy check,(exception from hresult : 0x80131402)
any one knows any solution about this error ,,
thanks in advance
hello
|
|
|
|
|
hi
here is your help
http://www.groupsrv.com/dotnet/about224229.html[^]
Hope it helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
How Can I Take A Chart Which Is Drawn In MsExcel 2003 To Visual Basic 6.0
Please Reply As Soon as Possible..
Manoj
|
|
|
|
|
Member 4720591 wrote: How Can I Take A Chart Which Is Drawn In MsExcel 2003 To Visual Basic 6.0
I think you can include a reference to Excel workbooks in your project and work with the file... Why would you be doing this in VB6 anyway?
|
|
|
|
|
why does posting a 'vb6' questions a big deal?
while this is still a Visual Basic Forum..
i never really like this... being a programmer...whhargghh!!
|
|
|
|
|
anthoy wrote: why does posting a 'vb6' questions a big deal?
Because VB6 is dead and Microsoft has not supported it since March 2005.
anthoy wrote: this is still a Visual Basic Forum..
True, but it is mostly VB.NET now.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Member 4720591 wrote: How Can I Take A Chart Which Is Drawn In MsExcel 2003 To Visual Basic 6.0
(1) Please don't shout!
(2) You can use the same ActiveX component Ms Excel uses, i.e. Ms Chart .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Why are you still using VB6? Microsoft stopped supporting it almost 3 years ago.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Please help me...
in above question..
Thanks..
T@SU
|
|
|
|
|
Hi,
You can use like this.....
CShort(str) => (short)str;
* str = any var. or exp.
regards
Ashish K. Vyas
|
|
|
|
|
Im not sure if (short)str works for - lets say a string.
Better use Convert.ToInt16(str)!
( So I tried:
<br />
string str = "22";<br />
short s = (short)str;<br />
with C#3 and this will not even compile! (As I thougt - you can't cast a string to a short - and before you bother: some types have inbuild implicit cast operators to handle those situations!)
|
|
|
|
|
System.Convert.ToInt16 is the closest equivalent.
In general, the System.Convert methods are closer to how the VB conversion macros work than the 'hard-core' C# casts.
The C# casts are closer (but not identical) to VB's DirectCast.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
C++ to Ruby Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
hi
In my application i want to import table from Access to Excel.I have include Microsoft Web Browser to display the excel sheet .When i am running the application.It display the sheet.But One error is pop up"The file can not access,it being used by another process"
Can anyone give the sol.here is my code
[code]
Try
Dim excel As New Excel.ApplicationClass
Dim wBook As Excel.Workbook
Dim wSheet As Excel.Worksheet
wBook = excel.Workbooks.Add()
wSheet = wBook.ActiveSheet()
filltemp()
Cmd.CommandType = CommandType.Text
'Cmd.CommandText = "Select * from SalRpt_temp"
Cmd.CommandText = "SELECT a.srno as Srno,a.ename as 'Name Of Employee',a.pdays as 'Present Day',a.desig as Designation ,a.bs as Basic,a.dp as DP,a.total as Total,a.hra as HRA,a.cla as CLA,a.ta as TA,a.npa as NPA,a.other as'Other Allowance',a.tal as 'Total Allowance',a.net as 'Net Claim',a.pt as 'PTax',a.it as 'Income Tax',a.sal as 'SalAdv',a.pf as PF,a.lic as LIC,a.bank as 'Bank Recov',a.tdeduct as 'Total Deduction',a.netsal as 'Net Salary' FROM SalRpt_temp a"
Cmd.Connection = con
adp.SelectCommand = Cmd
adp.Fill(ds)
Dim dt As System.Data.DataTable = ds.Tables(0)
Dim dc As System.Data.DataColumn
Dim dr As System.Data.DataRow
Dim colIndex As Integer = 0
Dim rowIndex As Integer = 1
For Each dc In dt.Columns
colIndex = colIndex + 1
excel.Cells(1, colIndex) = dc.ColumnName
Next
For Each dr In dt.Rows
rowIndex = rowIndex + 1
colIndex = 0
For Each dc In dt.Columns
colIndex = colIndex + 1
excel.Cells(rowIndex + 1, colIndex) = dr(dc.ColumnName)
Next
Next
'AxWebBrowser1.Navigate("G:\Salary Package\salary.xls")
wSheet.Columns.AutoFit()
Dim strFileName As String = "G:\Salary Package\salary.xls"
AxWebBrowser1.Navigate(strFileName)
Dim blnFileOpen As Boolean = False
Try
Dim fileTemp As System.IO.FileStream = System.IO.File.OpenWrite(strFileName)
fileTemp.Close()
Catch ex As Exception
blnFileOpen = False
End Try
If System.IO.File.Exists(strFileName) Then
System.IO.File.Delete(strFileName)
End If
wBook.SaveAs(strFileName)
excel.Workbooks.Open(strFileName)
excel.Visible = True
Catch ex As Exception
con.Close()
MsgBox(ex.Message)
End Try
[/code]
plz help me.My technology is vb.net2003 + ms access
poonam
|
|
|
|
|
Hi,
I am also using same thing in mine project, however I don't have enough time to look into your code but I am sending u mine code so it will be easy for u to check it out what was wrong with your code.mine code is error free. let u try it.........
Imports Microsoft.VisualBasic
Imports Excel
Imports System
Imports com.lowagie.text
Imports com.lowagie.text.Image
Imports pdfWriter = com.lowagie.text.pdf.PdfWriter
Imports com.lowagie.text.pdf.PdfPTable
Imports java.io
Public Const vbCenter = 2
Public Const vbRightJustify = 1
Public Const vbLeftJustify = 0
'/* Master Report Section Start * /
Public Function BranchMaintenanceReport(ByVal strSearchText As String, Optional ByVal strUserNo As String = "") As String
Dim objXL As New Excel.Application, wbXL As Excel.Workbook, wsXL As Excel.Worksheet
Dim intRow As Long, intCol As Long, intColCount As Long, intSNo As Long
Dim rs As New ADODB.Recordset, SQL As String
'Dim st As New ADODB.Stream
Dim psUtil As New PensionSystemUtil
Dim ctr As Integer
Dim tempDir As String, fileName As String, filePath As String
fileName = ""
intRow = 0
intColCount = 3
wbXL = objXL.Workbooks.Add
Try
'intRow = intRow + 1
'wsXL.Range(wsXL.Cells(1, 1), wsXL.Cells(1, intColCount)).Merge()
'SQL = "select * from sa_company_logo where company_code='" & p_company & "'"
'psUtil.ConnectToHDDB()
'rs = New ADODB.Recordset
'rs.Open(SQL, psUtil.conHD, 2, 3)
'If Not rs.EOF Then
' st = New ADODB.Stream
' st.Open()
' st.Type = ADODB.StreamTypeEnum.adTypeBinary
' st.Write(rs.Fields("company_logo").Value)
' If psUtil.IsPathExists(tempDir + "\CompanyLogo.jpg") Then
' psUtil.KillFile(tempDir + "\CompanyLogo.jpg")
' End If
' st.SaveToFile(tempDir + "\CompanyLogo.jpg", ADODB.SaveOptionsEnum.adSaveCreateOverWrite)
' wsXL.Shapes.AddPicture(tempDir + "\CompanyLogo.jpg", _
' Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, 0, 0, 650, 100)
' wsXL.Rows(1).RowHeight = wsXL.Shapes.Item(1).Height
' st = Nothing
'Else
'End If
'intRow = intRow + 1
''-> Cell 3,1 Report Name and Report Period
'SetFont("Branch Maintenance Report ", "Arial", 16777215, True, False, False, 16, vbCenter, 16711680, wsXL, 3, 1)
'wsXL.Range(wsXL.Cells(2, 1), wsXL.Cells(2, intColCount)).Merge()
If psUtil.ConnectToPFDB Then
tempDir = System.Configuration.ConfigurationManager.AppSettings("applicationHome") + _
System.Configuration.ConfigurationManager.AppSettings("tempDir") + strUserNo
If Not psUtil.IsPathExists(tempDir, True) Then
psUtil.MakeDir(tempDir)
End If
For ctr = 1 To wbXL.Sheets.Count - 1
wbXL.Sheets(ctr).Delete()
Next
wsXL = objXL.ActiveSheet
wsXL.Name = "BranchMaintenanceReport"
'-> Header Rows
intRow = intRow + 1
wsXL.Cells(intRow, 1).Value = "S.No."
wsXL.Cells(intRow, 2).Value = "Branch Code"
wsXL.Cells(intRow, 3).Value = "Branch Name"
For intCol = 1 To intColCount
wsXL.Cells(intRow, intCol).BorderAround(Excel.XlLineStyle.xlContinuous, XlBorderWeight.xlMedium, XlColorIndex.xlColorIndexAutomatic)
Next
SQL = "SELECT Branch_Code, Branch_Name FROM Branches WHERE (Deleted <> 'Y' OR Deleted IS NULL) "
If strSearchText <> "" Then
SQL += "AND Branch_Name LIKE ('" + strSearchText + "%') "
End If
SQL += "ORDER BY Branch_Name"
rs = New ADODB.Recordset
rs.Open(SQL, psUtil.conPF, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockReadOnly)
intSNo = 0
Do While Not rs.EOF
intRow = intRow + 1
For intCol = 1 To intColCount
wsXL.Cells(intRow, intCol).BorderAround(Excel.XlLineStyle.xlContinuous, XlBorderWeight.xlMedium, XlColorIndex.xlColorIndexAutomatic)
Next
intSNo = intSNo + 1
wsXL.Cells(intRow, 1).Value = intSNo
wsXL.Cells(intRow, 2).Value = rs("Branch_Code").Value.ToString
wsXL.Cells(intRow, 3).Value = Trim(rs("Branch_Name").Value.ToString)
rs.MoveNext()
Loop
wsXL.Columns(1).columnWidth = 5
wsXL.Columns(2).columnWidth = 11
wsXL.Columns(3).columnWidth = 50
wsXL.Range(wsXL.Cells(1, 1), wsXL.Cells(intRow, 3)).WrapText = True
wsXL.Range(wsXL.Cells(1, 1), wsXL.Cells(intRow, 3)).VerticalAlignment = Excel.XlVAlign.xlVAlignTop
wsXL.PageSetup.CenterFooter = "Page &P of &N"
wsXL.PageSetup.LeftFooter = strUserNo
wsXL.PageSetup.RightFooter = Format(Now, "dd-MMM-yyyy HH:mm")
wsXL.PageSetup.Orientation = Excel.XlPageOrientation.xlPortrait
wsXL.PageSetup.PrintTitleRows = "$1:$1"
wsXL.PageSetup.Zoom = 70
'-> No Report Means Nil...
If intRow = 1 Then
intRow = intRow + 1
For intCol = 1 To intColCount
wsXL.Cells(intRow, intCol).BorderAround(Excel.XlLineStyle.xlContinuous, XlBorderWeight.xlMedium, XlColorIndex.xlColorIndexAutomatic)
Next
wsXL.Cells(intRow, 2).Value = "NIL"
Else
End If
fileName = "BranchMaintenanceReport-" + Format(Now, "dd-MMM-yyyy") + ".xls"
filePath = tempDir + "\" + fileName
If psUtil.IsPathExists(filePath) Then
psUtil.KillFile(filePath)
End If
wsXL.SaveAs(filePath)
Else
Throw New Exception("DB Connection Error")
End If
Catch ex As Exception
Throw ex
Finally
wbXL.Close(False)
objXL.Quit()
psUtil.CloseConnectionPF()
End Try
BranchMaintenanceReport = fileName
End Function
thanks
ashish
|
|
|
|
|