|
Message Removed
modified 9-Nov-18 11:29am.
|
|
|
|
|
hi
please help me i have a project, need to write a code in ms access or python to do the able to press a button on the form windscreen that scans an image into my database field.
|
|
|
|
|
|
Have you contacted the manufacturer of said scanner and asked them how to interact with it programmatically? Probably through an API that they would have to provide.
As things stand, I could probably tell you how to interact with my old scanner - but you can bet your bottom dollar it won't work for yours. So more detail would be needed.
As an aside, storing the actual scanned image onto your "database field" is probably going to be a very bad idea. The Access file is going to get very big very quickly. You should consider storing the image on the file system (it's what it is designed for) and storing a link to it on the database itself (hint - using explicit paths or drive mappings is not a good idea - a rather bitter experience with FileNet proved this to me in the past)
|
|
|
|
|
the database program consith of the following fields
Name
Surname
Scanned document of The Person
Please help i am new to programming i do not want to loose hope!
|
|
|
|
|
Quote: Have you contacted the manufacturer of said scanner and asked them how to interact with it programmatically? Probably through an API that they would have to provide.
If you are new to programming then getting a scanner to work through an API is probably beyond your current capabilities.
Your table (it is not a database) should also include a unique identifier for the person (after all, people can have the same name).
Do not store the actual document on the database, store it's relative path or it's path relative to a fixed folder name.
|
|
|
|
|
HI
I NEED HELP IN TRYING TO WRITE DATABSE PROGRAM TO IN ACCESS OR PYTHON CAPTURE THE NAME, ID NUMBER, ADDRESS, PHONE NUMBER, AND FIELD TO ABLE TO SCAN DOCUMENT TO FROM A FLAT BED SCANNER TO MY ACCESS DATABSE FIELD.
WHEN I PRESS A BUTTON ON THE FORM. I AM STILL LEARNING PYTHON AND ACCESS
PLEASE HELP
|
|
|
|
|
|
Scenario:
one User1 press the save gets the last number 1000012 on the header then Run SP for Details saving(with 3 detail line items)
at the same time user2 press the save gets 1000013 on the header then Run SP for Details saving
(with 1 detail line items)
after checking after checking users inserted
user1 has 4 lines
user2 has 0 lines
ALTER PROCEDURE [dbo].[sp_HeaderSave] (@Lastnumber Decimal) AS
BEGIN
INSERT INTO Header (DOCNo, VersionNo, NoteDate)
VALUES (@Lastnumber,'VersionNo',GETDATE())
END
ALTER PROCEDURE [dbo].[sp_DetailSave] (@Lastnumber Decimal) AS
BEGIN
INSERT INTO Detail(DOCNo, ItemNo, Qty)
VALUES (@Lastnumber,'Items One',12)
END
thank you,
|
|
|
|
|
|
i tired this, how can i pass the @lastnumber it came from other table?
CREATE TABLE ControlNumbers (
LastNumber Varchar(50)
)
|
|
|
|
|
Hotaxion wrote: CREATE TABLE ControlNumbers (
LastNumber Varchar(50)
)
Interesting! In your OP you declared LastNumber as "Decimal". Now you show some other LastNumber which is in this case Varchar(50).
Are these two different? Or which type is correct?
And why not use the int with Identity? Something like:
CREATE TABLE ControlNumbers (
LastNumber Int IDENTITY(1,1)
)
|
|
|
|
|
the front end of the application is returning last number and saving it like this "M01-00002" on the Table i get the Right(lastnumber,5) then Plus 1 ty
|
|
|
|
|
As I said, either use an IDENTITY column, or use a SEQUENCE .
A varchar column can't automatically generate new values.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
the scenario is i can't modified/change the Table datatype coz other application is using it.. lets say the table is on our ERP.
|
|
|
|
|
Another technique is to have another table that just generates the ids for you
CREATE TABLE IdsList(id INT IDENTITY(1,1), datum CHAR(1));
In your (single) stored procedure first do this
INSERT #IdsList(datum) VALUES('x');
declare @lastnum int = (SELECT SCOPE_IDENTITY()) I would also suggest putting your stuff into a single SP and wrapping it all up in a transaction
ALTER PROCEDURE [dbo].[sp_HeaderSave] (@Lastnumber int OUTPUT) AS
BEGIN
BEGIN TRANSACTION [MyTrans]
BEGIN TRY
INSERT #IdsList(datum) VALUES('x');
SET @lastnumber int = (SELECT SCOPE_IDENTITY())
INSERT INTO Header (DOCNo, VersionNo, NoteDate)
VALUES (@Lastnumber,'VersionNo',GETDATE())
COMMIT TRANSACTION [MyTran]
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION [MyTran]
END CATCH
END
|
|
|
|
|
AKA the poor man's SEQUENCE[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I have a friend who cosponsors a conference every 2 years and manages the sending out of meeting notices and other items to the 2000 or so possible attendees via email. Can anyone recommend a Mail Merge type program, free or not?
Charles Wolfe
C. Wolfe Software Engineering
|
|
|
|
|
|
He has been using Google's mail merge, but it has limitations e.g. can't send more than about 900 emails in a batch and he's got to get out 2000 plus several times a year. He needs something easier to manage than Google's and allows more messages to be sent out at a time.
Charles Wolfe
C. Wolfe Software Engineering
|
|
|
|
|
You should have followed the link ... it was a google search for mail merge programs, not a link to googles mail merge program!
|
|
|
|
|
So I can add and delete Mongo documents but I ran into trouble with updates using HTTPPut.
When I get the record from the controller, the ObjectId in Angular is sort of truncated down to the string. When I pass it back to the controller, the controller complains that it's not a valid MongoDB ObjectID and HTTP 400 me. The response was not a valid ObjectID.
I tried changing my angular model Id to object
public Id: string --- Before
public Id: object --- After
Took the BSON decorators out of the .Net Model, which is the MongoDB model
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public ObjectId Id { get; set; }
Not really sure what direction to go here to keep my mean stack.
HtTP Response
HTTP/1.1 400 Bad Request
Transfer-Encoding: chunked
Content-Type: application/json; charset=utf-8
Vary: Origin
Server: Kestrel
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: <a href="https://localhost:44367">https:
X-Frame-Options: DENY
X-SourceFiles: =?UTF-8?B?RzpcamtpcmtlcnhBbmd1bGFyXGFwaVxwb3J0Zm9saW9zXFVwZGF0ZVBvcnRmb2xpb1w1YmFkNTEyMGM0MzFjYjA1NjQxNTE2NTk=?=
X-Powered-By: ASP.NET
Date: Thu, 27 Sep 2018 23:09:47 GMT
7f
{"Id":["Error converting value \"5bad5120c431cb0564151659\" to type 'MongoDB.Bson.ObjectId'. Path 'Id', line 1, position 32."]}
0
If it ain't broke don't fix it
Discover my world at jkirkerx.com
modified 27-Sep-18 19:11pm.
|
|
|
|
|
It looks like a fairly standard serialization error. I don't think you need the BsonRepresentationAttribute here.
Have you had a look at the docs:
Mapping Classes
The default for Id mapping is the string type, but you can use ObjectId as you are, but you need to set a specific IdGenerator.
Going through the references for the various IdGenerators in the MongoDB.Bson.Serialization.IdGenerators namespace, it looks like there are 3 candidate generators for ObjectId. I don't know which one is more appropriate for your use case, but if I were to venture a guess the general ObjectIdGenerator should be appropriate:
MongoDB.Bson.Serialization.IdGenerators Namespace
So, your mapping ultimately should look like:
[BsonId(IdGenerator = typeof(ObjectIdGenerator)]
public ObjectId Id { get; set; }
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
I thought about it last night and decided to just remove that column and not use the BSON Object ID, but to use the string version of the Object ID instead. This might get me later on when I find out that I need that Object for something, not sure what yet, To lookup the server that wrote the record or the other data stored in the ObjectId.
After testing just now, I can finally reach the .Net Controller for Update without my posted error.
Well basically my mean stack now works for updates using HTTPPUT. First time so I'm excited because it completed my stack operations.
But I'll go ahead and investigate and try that type and see what happens.
I thought maybe I needed to decorate the controller action with something that would regenerate the ObjectId back to the proper format.
Thanks for helping me!
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
Do I really need to store that Object ID in it's natural format?
Or is it possible to just store the string, and then convert it back to it's natural format using something on the .Net Core side if I need it? Maybe on the Angular side there is something to convert it with as well?
My mean stack fully works now, guess I'll try your research and see what happens. If it works I'll store the Object.
This is how my Mongo record looks now.
{
"_id" : "5bae68208301500628d80f8c",
"TimeStamp" : ISODate("2018-09-28T17:42:57.068Z"),
"Name" : "Long Beach Grand Prix 2008",
"Description" : "I took this photo at the Long Beach Grand Prix",
"CreatedBy" : "admin",
"HTML" : "",
"AvatarB64" : "data:image/jpeg;base64, data string.
"AvatarName" : "5bae68208301500628d80f8c.jpg",
"AvatarType" : "image/jpeg",
"AvatarUrl" : "<a href="https://localhost:44367/content/images/avatars/portfolios/5bae68208301500628d80f8c.jpg">https:
"AvatarX" : 256,
"AvatarY" : 256,
"AvatarStatus" : true
}
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|