Hello,
I'm using a vb.net program to write values to the database and I'm not sure how I should be creating the "Table ID" values.
Here is an example. I created one row in nuBuilder (1002) and the other with my vb.net program but the test_id is showing blank on the data I entered from a vb.net program (1001).
test_id num text1 text2
" " 1001 test test
625480430e8b516 1002 test test
Any help is very appreciated.
Thanks
Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Creating the ID Value
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact:
Re: Creating the ID Value
Hi,
Your question might be better suited for a vb.net forum (stackoverflow etc.). I did a quick google search and found this code: https://stackoverflow.com/a/64881291/10132321
The ids are not exactly the same as the ones that nuBuilder generates but they should just do the job.
Your question might be better suited for a vb.net forum (stackoverflow etc.). I did a quick google search and found this code: https://stackoverflow.com/a/64881291/10132321
The ids are not exactly the same as the ones that nuBuilder generates but they should just do the job.
-
- Posts: 2
- Joined: Mon Apr 11, 2022 9:27 pm
Re: Creating the ID Value
Hello Kevin,
I was hoping that I could do it the same way as nuBuilder or if there was some built in way to generate the id's but I guess your right I should just look at this as a .net problem and find another way to code it in.
I ended up using the UUID() sql function to create a value and that seems to be working.
Thanks for your help
Thomas
I was hoping that I could do it the same way as nuBuilder or if there was some built in way to generate the id's but I guess your right I should just look at this as a .net problem and find another way to code it in.
I ended up using the UUID() sql function to create a value and that seems to be working.
Thanks for your help
Thomas
-
- Posts: 135
- Joined: Tue Dec 12, 2017 11:28 pm
- Location: Aberdeen, UK
- Has thanked: 9 times
- Been thanked: 13 times
Re: Creating the ID Value
hello Thomas,
Back in the day, the good folks at nuBuilder created an MS-Access program to convert data and some application objects from MS-Access. It was called A2N. In it there is a VBA function:
where nextID is a global integer variable. I dare say this could be converted to vb.net quite easily. The prefix could be changed to anything you want.
I hope this helps.
Neil
Back in the day, the good folks at nuBuilder created an MS-Access program to convert data and some application objects from MS-Access. It was called A2N. In it there is a VBA function:
Code: Select all
Function nuID()
nuID = "i" & LCase$(Hex(CLng(Format(Now(), "yymmdd"))) & Hex(CLng(Format(Now(), "hhnnss"))) & Hex(nextID))
If nextID > 9800 Or nextID = 0 Then
nextID = 1000
Else
nextID = nextID + 1
End If
End Function
I hope this helps.
Neil