Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Adding data to a Pocket PC access database ?

Posted on 2004-08-16
4
Medium Priority
?
188 Views
Last Modified: 2010-05-02
I have a database installed on my pocket PC, and am am trying to write a small apllication for data collection.

As you know that you can't have a "ID" field in a Pocket Databse which generates it's own random number, so you have to insert a random number yourself.

I have this code which generates a 10 digit random number:

        Dim NewID As Long
        Dim Cntr As Integer
   
        Randomize
   
        For Cntr = 1 To 10
            NewID = NewID & Int(Rnd * 10)
        Next

But when I try to enter it into the table:

        rs.AddNew
        rs.Fields("ID") = NewID
        rs.Update

I get a error saying "A literal value in the command overflowed the range of the type of the associated column"

The data type of the ID column in table is a Long Integer as it should be. I have tried to convert the NewID variable in to a Long Interger via CLng(NewID) but it still throws the same error.

Any ideas ?
0
Comment
Question by:markh51
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 26

Accepted Solution

by:
EDDYKT earned 200 total points
ID: 11808926
Try to use 9 digits instead

max long is 4294967295
0
 
LVL 5

Expert Comment

by:amit1978
ID: 11809409
Hello,

I hope u r working in eVB for Pocket pc application, but in pockect PC there is only one datatype varient. which is sub divided into different data formats.

0
 
LVL 48

Expert Comment

by:Mikal613
ID: 11809579
If its a AutoNumber or Identity you cant set the number
0
 

Author Comment

by:markh51
ID: 11810000
EDDYKT:

Thanks for that, it works fine now.

Quick simple answer just how I like it ;)

Cheers.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question