|
Hi Experts,
I call SAP RFC from VB (VS 2005) for uploading data from SQL Server to SAP custom table. Connection and even RFC call in SAP works fine but I dont understand how I can pass SQL table to RFC in my VB code.
Can you give me your thoughts or any link which will give me some info. on the same on sending table to SAP RFC...it is array insert..
Thanks in advance..
Yogi
|
|
|
|
|
|
Same response to the last time he asked - we don't know. lol.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
We have third party software that has 20 MS Access database. The software resides on two boxes: 1 production and 1 for fail over.
I'm creating an app the copies the databases at different intervals; some monthly, some daily, and some every 30 sec to the fail over box. I plan to use a single class (CopyDB) to handle the copying. My question is: since I have three timers running how do I ensure that I do not get a race condition or that I do not miss one of the copies (monthly, daily) because the class was being used to copy (every 30 sec). Will SyncLock be sufficient?
Thanks in advance for you suggestions
|
|
|
|
|
Doug.Aliff wrote: We have third party software that has 20 MS Access database
If you have 3 timers to handle this those timers should run in there own thread and execute there own code (so each there own instance of the copydb class). So I don't think you'll have a problem with that.
The problems I see are:
0) file locking, but I don't think that's going to be a problem if you only copy the files.
1) time: 20 access database over network in 30sec?
2) performance: doing something this 'heavy' every 30sec is going to take a lot off power.
|
|
|
|
|
First let me offer you my sympathies and condolences, 20 Access DBs
Why do you have 3 times, you may have 3 conditions and different processes for each condition but you only need 1 timer. In your tick event simply test the 3 conditions (duration from last copy for the 3 types), do any copies needed and move on.
I know you have no control over the access Dbs but this DR method actually sounds like a D. If failover is so critical that you need to copy a DB every 30 seconds you have a SERIOUS design problem. Also I think Access used to have a replicate function way back when, you might want to raise that with the vendor.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: If failover is so critical that you need to copy a DB every 30 seconds you have a SERIOUS design problem.
Agreed. You might want to consider upgrading to SQL Server where possible. That won't break any applications that are embedded in the database - Access Forms (and query's and reports) can handle distant SQL-Server tables like they were local MS-Access tables
SQL Server would also make it easier to protect the data, using synchronization and backup-policies.
Good luck
I are troll
|
|
|
|
|
Agreed, agreed, agreed
How much data are we talking here? You download SQL server express for *free* which allows for DBs up to 4 gig in size (and still gain some performance, scalability, backups benefits).
If you just plunked down the $$, you could get a full version of SQL server in which you could do mirroring or log shipping. Or you could get Red Gate schema and data copy which have APIs for easily copying over the databases (although, you can create scripts yourself as well).
There are other options other than supporting 20 Access databases - yikes!
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
I agree with the others. If you need this kind of reliability, Access is NOT your solution. And, your solution is not even a solution. I'll tell you why in a second. Access is a desktop database with no facilities to replicate data for serious up-time requirements. Upgrade this thing to SQL Server if at all possible.
Copying the *.mdb files every 30 seconds will result in a major problem. If the production box fails during the copy, or the network path between the production and backup boxes fails for any reason, the copy of the database you're writing to will be destroyed. By doing a file copy, you've almost garanteed the failure of the backup database. Using Access, you really don't have a 100% redundancy solution.
Even reading the records from one copy of the database and writing them to the copy (NOT using file copy!), is not a solution. Well, not an easy solution. You'd have to read a record from one table, follow it's keys to other tables, and write each record to the appropriate tables, all in one transaction, to the copy of the database, then commit the transaction and move on to the next record in the table.
What you are trying to prevent by doing this is data corruption. What if you just read the records from one table and threw them into the copy, then the production box failes?? You haven't yet copied the data from related tables, thereby destroying the integrity of the data.
Your only solution is moving to SQL Server...
|
|
|
|
|
Thank everyone for you responses I'll try to reply to all in this one posting
Unfortunately, I am stuck with Access it is a third party package with paid support. I agree that this is a very poor design. I spoke to the vendor and they have been working on a SQL version for YEARS
I know file copy is not ideal but, as soon as the application opens it locks all of the DB's, so i can't query. If it were SQL I could at least do a dirty read, but I can't find away to do that in Access. So I'm kinda forced to use File copy. actually Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal
lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long)
Monthly copies are on tables that rarely change if ever.(Just being safe)
Daily copies are on tables that hold system settings that are changes when then customer requirements change. Software controls machinery via 32 serial ports.
30sec copies are probably over kill. A new item is produced every 5 minutes, these DB's hold the characteristics of each every piece made.
Network Issues----- what do you think about placing copies of the tables on the fail over box in a separate folder. Then test for conditions such as update time and then copying into the correct locations if conditions are met?
Again thanks everyone for you responses.
|
|
|
|
|
Background: I have a class wrapping httpwebrequest/response and executing on it's own thread with an event handler for DataArrival.
I have 2 web addresses I can use. 1 is with test data and 1 is an internal site with the real data. If i run the code on the production machine the site will fail (since it's not on the internal network) but it works fine with the test site. When the internal site fails it just returns a webpage from opendns saying it can't find the site (which is what should happen), but for some reason it crashes the program.
ModemTests - is a string array holding the information coming in (currently only using index 0)
ShowModem - this is the sub where the data gets processed
Public Sub Modem_DataArrival(ByVal sender As Object, ByVal e As DataArrivalEventArgs)
ModemTests(0).ModemInfo += e.RecievedData 'there is data in here when it crashes
If e.IsComplete Then
If ShowingModem = sender.tag Then
ModemTests(0).ModemRunning = False
Dim d As New SetTextCallback(AddressOf ShowModem)
Invoke(d, New Object() {ModemTests(0).ModemInfo}) 'error occurs here
End If
End If
End Sub
Crash error:
System.ArgumentOutOfRangeException was unhandled
Message="Length cannot be less than zero. Parameter name: length"
ParamName="length"
Source="System.Windows.Forms"
StackTrace:
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at ConnectionTools.frmMain.Modem_DataArrival(Object sender, DataArrivalEventArgs e) in D:\VS2008\WindowsApplication10\WindowsApplication10\frmMain.vb:line 72
at ConnectionTools.HttpRequestResponse.OnDataArrival(DataArrivalEventArgs e) in D:\VS2008\WindowsApplication10\WindowsApplication10\clsHttpRequest.vb:line 51
at ConnectionTools.HttpRequestResponse.ReadCallBack(IAsyncResult asyncResult) in D:\VS2008\WindowsApplication10\WindowsApplication10\clsHttpRequest.vb:line 199
at System.Net.LazyAsyncResult..ctor(Object myObject, Object myState, AsyncCallback myCallBack, Object result)
at System.Net.ConnectStream.BeginReadWithoutValidation(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
at System.Net.ConnectStream.BeginRead(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
at ConnectionTools.HttpRequestResponse.ReadCallBack(IAsyncResult asyncResult) in D:\VS2008\WindowsApplication10\WindowsApplication10\clsHttpRequest.vb:line 191
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
InnerException:
|
|
|
|
|
At a guess, I would say that ModemTests is not being initialized properly as an array. The String class has a default property such that MyString(x) returns the xth character; if MyString has no characters, you will get his error.
Added
I ran these two tests:
Dim s As String() = {}
Debug.WriteLine(s(0))
Dim s As String = ""
Debug.WriteLine(s(0))
Both returned IndexOutOfRangeException , which seems to blow my theory. The only other thing I can think of is that the problem is with the value of e.ReceivedData . You might want to stick in some diagnostic code to check the value before doing the assignment.
modified on Thursday, April 2, 2009 4:04 PM
|
|
|
|
|
I have this on form load, everything should be fine in the array.
For i As Integer = 0 To 4
ModemTests(i).ModemInfo = ""
ModemTests(i).Ping1Info = ""
ModemTests(i).Ping2Info = ""
ModemTests(i).SMTInfo = ""
ModemTests(i).ModemRunning = False
ModemTests(i).Ping1Running = False
ModemTests(i).Ping2Running = False
ModemTests(i).SMTRunning = False
Next
The thing is, it works fine with the test site. If i just change the site it crashes. I just don't know what the error wants from me. I've even tried passed just some text instead of a variable to the Invoke and it still gives the error.
|
|
|
|
|
Ok, i think i found the problem. The errors are occurring the ShowModem sub but for some reason are showing up as occurring at the Invoke statement.
Is there any way to disable the Threading check so you don't need all that Invoke code? I don't ever remember having to do that when using threads but last time i used VB.NET was a few years ago.
|
|
|
|
|
I thought the problem was with ModemTests(0).ModemInfo += e.RecievedData . My bad.
The only think I can see that might be wrong then is that ModemTests(0).ModemInfo should hold a reference to the method ShowModem . But to be honest, I've never used delegates like this, and I am completely unfamiliar with modem handling.
|
|
|
|
|
thanks in advance
modified on Friday, April 3, 2009 7:41 AM
modified 28-Nov-12 4:43am.
|
|
|
|
|
Seems awefully familiar to this thread you started [^]a short while back, check with the posts there. No need to repost everything.
|
|
|
|
|
|
See my post here. The exact same advice applies here.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Hi,
I have a html page where i have a link and 2 radio buttons and when i click the link i need to run cmd (with selected radio button as parameter to cmd) in the background ...
Please help regarding the same...(i need to use vbscript..)
|
|
|
|
|
By Using JavaScript you can Run Command as per your requirement.
or you can use BAT file for executing Command.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
Set wShell = WScript.CreateObject("WScript.Shell")
wShell.Run "c:\windows\system32\calc.exe" Google is your friend, my friend
I are troll
|
|
|
|
|
|
patricemburu wrote: anyone with vb 6.0 code for netmeeting or knows where i can get it?
Nobody is just going to give you code.
I don't know what you mean by 'netmeeting' but if its a program, other developers worked hard on it to create it so by just requesting there work (code) your requesting to steal from them.
patricemburu wrote: pls
you have a full keyboard, use it.
patricemburu wrote: patricemburu@yahoo.com
NEVER a good idea to put your email into a forum post.
There is an email button (just as there is a reply button).
patricemburu wrote: vb 6.0
It's dead and unsupported, so why on earth would you still use it.
|
|
|
|
|
Right
- NetMeeting was not written in VB 6.0. If anything, it would have been written in C, C++ or assembler
- There is no comparison between those languages
- Stealing code is considered unethical or illegal
- Capitalisation is rather useful
- Your keyboard is not locked into the phrase 'pls'
- Posting your email is unwise for the following reasons:
- Spambots
- If you get the code, no-one else can learn from your question
|
|
|
|
|