|
I'm am working on a database in MS Access 2000. I have imported data from a text file.
Their are now two fields that imported in to a table:
Title and Subtitle
I want to make a macro or query (anything that is automatic) to combine the two values (Title and Subtitle) into one (MyTitle) for all the records (about 2,953). Thank you in advance.
-Peace
|
|
|
|
|
Not sure if this is what you are looking for but.
UPDATE yourtable SET main.combinedfield = [yourtable]![Title] & " " & [YourTable]![SubTitle];
|
|
|
|
|
Where do I put this code? I am trying to get it to update the field (if it needs to be updated) when the form is open. Or if I can make a macro that would do it.
|
|
|
|
|
I am not sure of your situation but I would suggest using the Acces macro builder and use the formrun or similar event to fire the import. The code is all VBA or VBscript so you may even find some code on Google that will do it for you. If you are importing this file every time the app opens you may need to work out a different strategy since this could eventually lead to errors. Good luck and I hope it helps.
|
|
|
|
|
I'm new to windows programming so please don't laugh.
I have a visual basic .NET program that i've created. I can install it on PCs and it runs fine.
I want to be able to put it on a server that is on our local network, and I want users to be able to run the exe from through their network neighborhood (over the network). My most desirable option is that the program need not be installed locally to be able to run from the network. (Of course .NET framework would have to be installed locally)
As it is now, if I copy the exe to some place on the network and try to run it from there I recieve a unhandled exception error right away, even if the user has write permissions to that directory.
Where do I need to go next with this program to be able to do this? Remote Services???
|
|
|
|
|
You should be able to copy the executable to a share and run it with no problems as long as the required runtimes are installed on the local machine.
If you're getting an exception on the server, then your best bet would be to either install a dev environment on the server to allow you to step through the code and found it where it craps out.
Although, I'd recommend (it help find out what's causing it instead of possibly just fixing it) using the process of elimination in your code by commented certain parts until it starts working and take it from there.
Jeremy Falcon
|
|
|
|
|
Running a .NET program from a shared drive is not the same as running it locally, because of code-access security. Local programs are more "trusted" than remote ones, so depending on what your app is trying to do, it may get a permissions exceptions.
Couple different ways to tackle this:
* modify the .NET policies for your particular application, on each PC (by using the control panel .NET wizards)
* change your app to only do things that it is allowed to in that particular environment. For example, if you are saving files to a local drive, maybe try using isolated storage instead.
* run the app locally
my blog
|
|
|
|
|
As you have two different answers, I just thought I'd wade in and add my own opinion. I'd go with Steven Campbell's reply. I'm guessing the exeption you are getting, although you don't say it, is a Security Exception.
.NET code won't run over a network unless you set the policy to trust it. You can either set up each machine to trust .NET code in a specific directory/share on the network, or you can sign all your dot net code and set the security policy to trust code that has a trusted signature.
If you have a lot of .NET code that is going to be places in lots of different places on the network then I suggest that you sign it all as it will be easier administer the security policies for .NET
I hope this helps.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
Thanks for the help.
How do I sign my .NET code?
|
|
|
|
|
|
You should create a key/pair file with the .NET tool sn.exe found somewhere like here ..\msvisualstudio.net\FrameworkSDK\bin\sn.exe. run this from the command line with -? to show usage. I think to create a snk (Strong name key) file you use -k. look it up in help also, type Sn.exe in the index of help.
After you have the SOMEHTING.snk file you need to add it to your project Obj folder(I think) and to the Assembly.info add this line
<Assembly: AssemblyKeyFile("..\SOMEHTING.snk")>
After you have built the exe you can increase the assembly trust on the users computer using the NET Framework 1.1 Configuration tool
Programs>Administrative tools>...
Configure Code Access Security Policy > Increase Assembly Trust
Browse to the Exe on the network. follow the instructions but you will find a radio button that says something like All assemblies with same assembly public key.
selecting this will prevent you from having to do this everytime you create a new app, provided you build each app with the same SOMEHTING.snk file.
you could also do this config stuff in an MSI file but that you would have to figure out cause I do not know it.
Hope that helped
|
|
|
|
|
Hi,
I have the following Keyboard hook module and would like to convert it so that it can hook application File Open call instead. Could someone help me with this.
...........................................
Module TestHook
Public Const WH_KEYBOARD = 2
Public Const VK_SHIFT = &H10
Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Integer, ByVal ncode As Integer, ByVal wParam As Integer, ByVal lParam As KBDLLHOOKSTRUCT) As Integer
Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Integer) As Integer
Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Integer, ByVal lpfn As Integer, ByVal hmod As Integer, ByVal dwThreadId As Integer) As Integer
Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Integer) As Integer
Public hHook As Integer
Public Function KeyboardProc(ByVal idHook As Integer, ByVal wParam As Integer, ByVal lParam As KBDLLHOOKSTRUCT) As Integer
'if idHook is less than zero, no further processing is required
If idHook < 0 Then
'call the next hook
KeyboardProc = CallNextHookEx(hHook, idHook, wParam, lParam)
Else
'check if SHIFT-S is pressed
If (GetKeyState(VK_SHIFT) And &HF0000000) And wParam = Asc("S") Then
'show the result
MsgBox("Shift-S pressed ...")
End If
'call the next hook
KeyboardProc = CallNextHookEx(hHook, idHook, wParam, lParam)
End If
End Function
End Module
Private Sub Form_Load()
hHook = SetWindowsHookEx(WH_KEYBOARD, AddressOf KeyboardProc, App.hInstance, App.ThreadID)
End Sub
Private Sub Form_Unload(Cancel As Integer)
'remove the windows-hook
UnhookWindowsHookEx hHook
End Sub
...........................................
Thanks,
|
|
|
|
|
You can't convert this to catch a File Open. There is no hook for that. What, exactly, do you want to accomplish by hooking the File System?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I would like to intercept open calls by any applications that try to open files with the *.txt, for example. I would like to perform some routine before the application proceeds with the open.
|
|
|
|
|
You would have to write what is essentially a device driver. The driver would attach to the NTFS file system and report back with the details your looking for. You can't do it entirely in VB.NET. The .NET languages, except for C++, are too high-level for work like this. You could write your app that does the actual reporting in VB.NET, but the driver work is best done in C++.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Would you happen to have a sample of this in C++ or a site that I can go to for more info?
|
|
|
|
|
Nope, and I doubt you'll find many samples either. It requires very deep knowledge of the internals of NTFS and Windows to write one. People usually bill you for that kind of knowledge. But...
There is an example of such a technique in the FileMon utility at www.sysinternals.com. There is no source for it, you you'll see the .dll in the package. Under the Source nav menu on the left side of their page, you'll find a utility called FunDelete. There is source code in its .ZIP file that demonstrates some of the techniques you'll need to get one these drivers running.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks. I will have a look.
|
|
|
|
|
Hi.
I’m trying to write and if then statement that checks to see if a string contains a certain value.
Here is how I thought it worked:
If TheString.IndexOfAny(“This Text”) then
I want the statement to return True if the string contains “This Text” anywhere within the string.
Can anybody tell me how this should be written?
Thanks
Brad
|
|
|
|
|
There is a function in Microsoft.VisualBasic called Instr that can, given two strings, give you the number of times that string2 occurs in string1.
Try using this function
<br />
Function ContainsStr(Str1 As String, Str2 as String) As Boolean<br />
Return (Microsoft.VisualBasic.Instr(Str1, Str2) > 0)<br />
End Function <br />
Hope This Helps
|
|
|
|
|
This looks like it will do the trick.
Thank you very much!
Brad
|
|
|
|
|
i think it will work like this .
if theString.IndexOfAny="This Text" then
ROLI
|
|
|
|
|
|
declare a boolean variable as say
Dim val As boolean
then after the statement,
If TheString.IndexOfAny(“This Text”) then
type
val="true"<br />
Endif
OR
return "true":|
u can then reference variable val elsewhere as the value returned
|
|
|
|
|
I am trying to play and increment tracks in a listbox control with the windows media player active x control (OCX).
The following line of code will play a selected item.
AxWindowsMediaPlayer1.URL = ListBox1.SelectedItem
I need to be able to start from a point in the listbox, for example the third
track, with out selecting it with the mouse, and then I need to play and increment through the tracks.
The following line gives me an error that the list box has no default property:
AXWindowsMediaPlayer1.URL = ListBox1(3)
Any sugestions?
Many thanks,
Glen Conaway
|
|
|
|