|
Considering Access is a file-based database, with no communication server at all, it's impossible to do directly. You've have to build some kind of server component to handle all the database access over a network connection of your choice.
|
|
|
|
|
I see...
But, i was asked to develop a client-server applications using Microsoft Access. Is the only way to make connection to access database over the network,just to share the folder where my application is, and the 2nd option is using access database project (ADP) with SQL server? (sorry for my bad english, hope you'll understand)
modified on Monday, March 21, 2011 7:53 PM
|
|
|
|
|
The only way to get at an Access database without writing your own communication component is through a network share. You have to be able to map a drive to wherever the database sits. I'm not saying you HAVE to map a drive, you just have to be ABLE to map a drive to it. You can use the database without a drive letter if you can use a UNC path to get at it.
You do NOT have to use Access at all. If you have SQL Server, throwing Access in the middle just needlessly complicates your system.
|
|
|
|
|
Could you give a sample code for mapping drive without share the application folder?
|
|
|
|
|
You have no clue how Windows Networking works, do you? There is no code sample because you cannot map a drive to anything other than a shared folder.
|
|
|
|
|
Ok, thanks for your explanation.
|
|
|
|
|
How about if i build server component using vb 6 or microsoft access form? Could you give me a sample to do that?
modified on Wednesday, March 23, 2011 10:33 PM
|
|
|
|
|
No. I haven't touched VB6 in over 10 years.
I got my hands on VB.NET when .NET was a Beta and haven't looked back since.
If you have to make a server component just because you want to use Access, you're in deep trouble. Move to a database engine that supports this already, such as SQL Server, Oracle, MySQL, whatever... Access is probably the only database engine that doesn't support what you want to do, so why waste the effort on it?
|
|
|
|
|
|
Hi everybody,
I'm trying get my byte array into a structure successfully with the following code. Unfortunately I have no idea how to consider endianness of the data - I'd need the bytes swapped!
<StructLayout(LayoutKind.Sequential, Pack:=1)> _
Public Structure FILEHEADER
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=4)> Dim magic As String
Dim offset As UInt32
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=8)> Dim version As String
Dim fileSize As UInt32
Dim dittoKey As UInt32
Dim genericSize As UInt32
Dim industrySize As UInt32
Dim userSize As UInt32
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=100)> Dim fileName As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=24)> Dim timedate As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=100)> Dim creator As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=200)> Dim project As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=200)> Dim copyright As String
Dim encryptKey As UInt32
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=104)> Dim Reserved As String
End Structure
Sub Main()
Dim fh As FILEHEADER = New FILEHEADER
ByteArray = GetBytesFromFile(myFile)
Dim MyGC As GCHandle = GCHandle.Alloc(ByteArray, GCHandleType.Pinned)
fh = DirectCast(Marshal.PtrToStructure(MyGC.AddrOfPinnedObject, GetType(FILEHEADER)), FILEHEADER)
MyGC.Free()
Console.WriteLine("Magic:" & fh.magic)
Console.WriteLine("Offset:" & fh.offset)
Console.WriteLine("Version:" & fh.version)
Console.WriteLine("File Size:" & fh.fileSize)
Console.WriteLine("Ditto Key:" & fh.dittoKey)
Console.WriteLine("Generic Size:" & fh.genericSize)
Console.WriteLine("Industry Size:" & fh.industrySize)
Console.WriteLine("User Size:" & fh.userSize)
Console.WriteLine("File Name:" & fh.fileName)
Console.WriteLine("Time-Date:" & fh.timedate)
Console.WriteLine("Creator:" & fh.creator)
Console.WriteLine("Project:" & fh.project)
Console.WriteLine("Copyright:" & fh.copyright)
Console.WriteLine("Encrypt Key:" & fh.encryptKey)
Console.WriteLine("Reserved:" & fh.Reserved)
Console.WriteLine(StrDup(30, "-"))
'Console.WriteLine("actFlatAct:" & String.Concat((From s In fh.ActFlatAct Select s.ToString("f2") & " ").ToArray))
Console.WriteLine("FILEHEADER size:" & Marshal.SizeOf(fh))
Console.ReadKey()
End Sub
Does anyone have an idea how to get the bytes in the swapped endian order?
Thanks for your hints!
Mick
|
|
|
|
|
The marshaler doesn't support changing the byte order, so you'd have to do it yourself with a Custom Marshaler[^].
|
|
|
|
|
Thank you for making that clear, Dave. Would you think, considering overall performance, that the effort of custom marshalling makes sense at all then? I have a byte array in the wrong endian order, and might as well swap and assign the bytes to my structure within a loop.
|
|
|
|
|
I didn't know if you had contorl over that, but yes, that would work too.
|
|
|
|
|
Can I export to OpenOffice from DataGridView? I can export to MS Word and MS Excel.
|
|
|
|
|
There is this[^] pdf file which is in c#, if you are able to translate.
If not, I used c# openoffice interop as my search phrase, just substitute 'vb' for my 'c#' and see what you get. Bound to be something useful.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
ivo75 wrote: Can I export to OpenOffice from DataGridView? I can export to MS Word and MS Excel
Yes. You can probably open the files that you're generating for Word and Excel using OpenOffice Writer and Calc.
I are Troll
|
|
|
|
|
OK but can I export to word or excel without word or excel in my PC.
|
|
|
|
|
Yes, by exporting as RTF and CSV respectively. OpenOffice knows both formats too. Exporting to CSV is most easily done using a OleDb connection.
I are Troll
|
|
|
|
|
|
No. Without Word or Office installed, you cannot export to one of the Office native formats without Office installed.
Well, maybe. If you're trying to export to Office 2003 native formats, you'd have to find a third party library that can write those formats.
For Office 2007 and above, you can go through some of this[^] since Microsoft abandoned the proprietary formats and adopted an open XML file format instead.
|
|
|
|
|
..simply say "no", as the next question is going to be why it can't read Excel-files from Office 95/97
I are Troll
|
|
|
|
|
Is proprietary. Means you'll need the software installed, just as if it were a regular application like Autocad. Or go for OpenXML
I are Troll
|
|
|
|
|
Yes
see here[^]
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
Hello everybody,
I have a byte array holding a (non-windows) bitmap format (RGB as 10 bits each in a UInt32). In order to change it to a visible 8-bit image I have to do some bit-shifting on the pixels, but unfortunately looping through the pixels with
Dim RGBArray(CInt((PicFile.Length - ft.Position) / 4 * 3) - 1) As Byte
For i = 0 To (RGBArray.Length - 1) Step 3
' change Endianness
Dim buff As UInt32 = EndianConversion.SwapDWORD(brh.ReadUInt32)
' bit-shifting operation
RGBArray(i) = (buff And &HFFC) >> 4 ' Blue
RGBArray(i + 1) = (buff And &H3FFFFC) >> 14 ' Green
RGBArray(i + 2) = (buff And &HFFFFFFFC) >> 24 ' Red
Next i
takes a lot of time. Having seen how images can be manipulated with an image matrix, I wonder if that kind of operation might also be performed using a matrix on the whole byte array?
Is someone around who can tell me this or a faster way to get my image as bitmap?
Thanks
Mick
|
|
|
|
|
IMO existing code, such as GDI+, will not do format conversions for you. Its matrix operations preserve the pixel format, all they do is multiply and/or add pixel values and matrix coefficients, not bit masking or shifting.
There are a few optimizations you could apply to your code; in particular you should avoid calling methods for each and every pixel (RGBArray.Length, SwapDWORD, ReadUInt32); replace them by local variables, local code, and larger moves (say a scanline at a time).
FWIW: languages that don't support pointers (such as VB.NET) aren't as good as C/C++/C# for image processing.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|