ms access quirey question

N

nialltimpson

Hi I was wondering is it possible to read write to a memo field in ms
access, the same way you would read write to a text field? I have my
database set up and reading writeing to the databse ok using text field
but I have to now store strings which will contain 316 characters e.g

1315259804765771089746208008724780151971640940654061
5945089711350055105440014387233852223755558178959373
5901729523358226196346901333363266720160161567476750
8698500810033377223926558621622404221161922571217657
5908662820038302522362188659394554116014527409368579
573295108852401025657242056374503972313949815709
6436944847683848865450458408521580987232589912971236
713653320010771954202838636539445174893761859498584761
774348548858284051610193336458404802244737321229315795
259346400597219730922809042994571064196264789556436973
256754063980517342616225212190669661339367714653468330
0777901869239185845560584199360795573155

I need to do it beacuse Im encrypting ever thing in the database,

Thank if you can help
Niall
 
W

Wannabee

"nialltimpson" wrote
Hi I was wondering is it possible to read write to a memo field in ms
access, the same way you would read write to a text field?
Yes.

I have my
database set up and reading writeing to the databse ok using text field
but I have to now store strings which will contain 316 characters

Looks like you are storing one big integer having more than 300 digits in 10
base. Have you thought about Base64 or similar, more economical way of
storing encrypted data?
java.math.BigInteger.toString(int radix) can also help, give 36 as radix and
you get a shorter string which represents the same number in 36-base instead
of 10-base.
 
N

nialltimpson

"nialltimpson" wrote
Hi I was wondering is it possible to read write to a memo field in ms
access, the same way you would read write to a text field?
Yes.

I have my
database set up and reading writeing to the databse ok using text field
but I have to now store strings which will contain 316 characters

Looks like you are storing one big integer having more than 300 digits in
10
base. Have you thought about Base64 or similar, more economical way of
storing encrypted data?
java.math.BigInteger.toString(int radix) can also help, give 36 as radix
and
you get a shorter string which represents the same number in 36-base
instead
of 10-base.
instead
of 10-base.

Thats not a bad idea, but if I converted from base 10 to base 36, would it
be possible to change it back to base ten? and would it still represent the
same number? Ill give that ago. cheers,
 
W

Wannabee

"nialltimpson" wrote
Thats not a bad idea, but if I converted from base 10 to base 36, would it
be possible to change it back to base ten? and would it still represent the
same number? Ill give that ago. cheers,

Use the 2-parameter constructor BigInteger(String val, int radix) and give
the same radix 36.

String teststring = "1234567890"; // base 10
java.math.BigInteger a = new java.math.BigInteger(teststring);
String base36 = a.toString(36);

java.math.BigInteger b = new java.math.BigInteger(base36, 36);
String base10 = b.toString(10);

You get the original values, that is a.equals(b) == true and
teststring.equals(base10) == true .
 
N

nialltimpson

Yeah I did wah you said but now the out put is bigger than before!! i
giving 396 characters!! compared to 310

heres the output

e3l276zs439p4iofm5p1zf9ddt7wh47npbyxh4phiuya7dq12bg
sxo2kakhvtcwzhvvnouebestiyexqf17vy5gqjb9c8vtenzqscf
l9jnp9740zcfbwggcv99vg4pxngdj2ms6flynl1zkxj7hicehfg
hg58bpsc44rhus2q1270ufyk2hifqvn2sqj801n9210o5
6xvpc79dobf8htlzkoh0cjbd9q6e0pmbzl3nd14gqpwijhsd26cjj
yj44tok7ukrq6le55q2nccmdlkpbrxqaekjqt5udes29dj127m101
pqlx3ick8ga2npwf2i7ftzrvmivv2jjlmk6kag2515keq7ofacz3p
2t5dlj0lcpo4uwhvd9eri8fcgrma0un7phfu635

any ideas?
 
N

nialltimpson

also for some reason im not able to read and write to the database when the
field typee is "memo" heres the code that works with type "text"

Statement stmt = con.createStatement();


ResultSet row = stmt.executeQuery( "SELECT Username, password, forename,
surname FROM Login");

boolean endSearch = false;
while(endSearch == false)
{
row.next();
correctLogin = row.getString("Username");

and so on....
 
D

David Segall

nialltimpson said:
Hi I was wondering is it possible to read write to a memo field in ms
access, the same way you would read write to a text field?
It is.

"Microsoft Access provides two field data types to store data with
text or combinations of text and numbers: Text or Memo.

Use a Text data type to store data such as names, addresses, and any
numbers that do not require calculations, such as phone numbers, part
numbers, or postal codes. A Text field can store up to 255 characters,
but the default field size is 50 characters. To control the maximum
number of characters that can be entered in a Text field, set the
FieldSize property.

Use the Memo data type if you need to store more than 255 characters.
A Memo field can store up to 64,000 characters. If you want to store
formatted text or long documents, you should create an OLE field
instead of a Memo field.
 
N

nialltimpson

nialltimpson said:
Hi I was wondering is it possible to read write to a memo field in ms
access, the same way you would read write to a text field?
It is.

"Microsoft Access provides two field data types to store data with
text or combinations of text and numbers: Text or Memo.

Use a Text data type to store data such as names, addresses, and any
numbers that do not require calculations, such as phone numbers, part
numbers, or postal codes. A Text field can store up to 255 characters,
but the default field size is 50 characters. To control the maximum
number of characters that can be entered in a Text field, set the
FieldSize property.

Use the Memo data type if you need to store more than 255 characters.
A Memo field can store up to 64,000 characters. If you want to store
formatted text or long documents, you should create an OLE field
instead of a Memo field.
I have my
database set up and reading writeing to the databse ok using text field
but I have to now store strings which will contain 316 characters e.g

1315259804765771089746208008724780151971640940654061
5945089711350055105440014387233852223755558178959373
5901729523358226196346901333363266720160161567476750
8698500810033377223926558621622404221161922571217657
5908662820038302522362188659394554116014527409368579
573295108852401025657242056374503972313949815709
6436944847683848865450458408521580987232589912971236
713653320010771954202838636539445174893761859498584761
774348548858284051610193336458404802244737321229315795
259346400597219730922809042994571064196264789556436973
256754063980517342616225212190669661339367714653468330
0777901869239185845560584199360795573155

I need to do it beacuse Im encrypting ever thing in the database,

Thank if you can help
Niall


Thanks, I think Ill need to be useing the memo or the ole type you
mentioned the only thing is my standard querieys that I was useing tih
text field's are not working, there not throwing an error's but are
simpley not working. do know that could be wrong here's an examp of what I
mean,

con = DriverManager.getConnection(conStr);
Statement stmt = con.createStatement();
ResultSet row = stmt.executeQuery(
"SELECT Username, surname FROM Login");
correctLogin = row.getString("Username");


This along with ,update, insert statements.

Thanks for you help.
 
W

Wannabee

"nialltimpson" wrote
Yeah I did wah you said but now the out put is bigger than before!! i
giving 396 characters!! compared to 310

heres the output

e3l276zs439p4iofm5p1zf9ddt7wh47npbyxh4phiuya7dq12bg
sxo2kakhvtcwzhvvnouebestiyexqf17vy5gqjb9c8vtenzqscf
l9jnp9740zcfbwggcv99vg4pxngdj2ms6flynl1zkxj7hicehfg
hg58bpsc44rhus2q1270ufyk2hifqvn2sqj801n9210o5
6xvpc79dobf8htlzkoh0cjbd9q6e0pmbzl3nd14gqpwijhsd26cjj
yj44tok7ukrq6le55q2nccmdlkpbrxqaekjqt5udes29dj127m101
pqlx3ick8ga2npwf2i7ftzrvmivv2jjlmk6kag2515keq7ofacz3p
2t5dlj0lcpo4uwhvd9eri8fcgrma0un7phfu635

any ideas?

That's only 8 rows compared to the original 12 rows of about the same
length, so how can there be more characters? I thought you were storing one
big integer, but the linebreaks hint otherwise. So what is this excatly? It
wasn't 12 integers because the number of rows diminished. Looking at the
base 10 representation it looks like it can't be 8 integers. How many
integers are there and where do they start and end?
 
W

Wannabee

I made some experiments with the original numbers and compared the results
to these 8 new rows. I didn't try all possible combinations, but i suspect
they do not represent the same data so the output seems to be useless as a
testcase.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,217
Latest member
IRMNikole

Latest Threads

Top