在SQL如何将一个长度是10位bigint型的数值转换成IP形式

来源:百度知道 编辑:UC知道 时间:2024/07/01 13:52:59
如:将 1019176328转换成126.54.48.121的形式

最好用一个存储过程....
这个问是已经解决.........但是还有一个问题..就是..怎麽将这个IP转换成域名呢...急急急急急....兄弟们帮忙

为什么不用varchar储存呢一开始

将长整型转换为IP地址

Name: Convert LongIP to StringIP
Description: This function converts a Long Number (3232235521) into an IP Address ("192.168.0.1"). Why would you want to do this? Click here.
Inputs: anNewIP - IP Address as a Long Number (no dots)

Returns: Returns the string representation of an IP Address ("192.168.0.1")

Function CStrIP(ByVal anNewIP)
Dim lsResults ' Results To be returned
Dim lnTemp ' Temporary value being parsed
Dim lnIndex ' Position of number being parsed
' If pulling number from an Access Database,
' The variable Type "Long" ranges from -2147483648 To 2147483647
' You will first need To add 2147483648 to the number to parse correctly.
' anNewIP = anNewIP + 2147483648
' Parse highest numbers first
For lnIndex = 3 To 0 Step -1

' Parse the current value For this posi